Execute multiple tasks concurrently and gather results.
When building resilient applications, you often need to perform multiple operations in parallel to improve performance and user experience. Restate provides durable concurrency primitives that allow you to run tasks concurrently while maintaining deterministic execution during replays.
Operations such as calls, awakeables, and restate.After return futures which can
be safely waited concurrently using restate.Wait. Restate will log the order in which they complete, to make this deterministic on replay.
Don’t use Go routines:Do not try to combine blocking Restate operations using goroutines, channels or select statements. These cannot be used deterministically, and will likely lead to non-determinism errors upon replay. The only place it is safe to use these types is inside of a restate.Run function.