4 ms·
Hi Matei_Radu, Is it possible for spin to support actor-model pattern for eg. can it run long running process to execute trading strategies which will accept ti
by neophyt3 3y ago
Hi Matei_Radu,
Is it possible for spin to support actor-model pattern for eg. can it run long running process to execute trading strategies which will accept tick data every second
- matei_radu 3y agoHey, thanks for the question! The short answer right now is no. The behavior of the default (and most popular) trigger in Spin (the HTTP trigger) is to create a new instance for handling each incoming request. We made that choice primarily because we want to leverage the really good startup times for Wasm (and in particular for Wasmtime), and not running any guest code (in this case, business logic) until there is an actual incoming request means the server can execute other applications while idle. Now, HTTP workloads are not the only type of workloads that Spin can handle — because of the way it's built, it's entirely pluggable and you can build your own trigger (for example https://github.com/fermyon/spin-trigger-sqs https://github.com/fermyon/spin-trigger-sqs), and potentially have long-running processes, but that is not currently possible with Spin today.
- gdamjan1 3y agoyou can check out https://github.com/lunatic-solutions/lunatic https://github.com/lunatic-solutions/lunatic for that