ash-project / reactor

Reactor is a dynamic, concurrent, dependency resolving saga orchestrator.
https://ash-hq.org/
MIT License
44 stars 6 forks source link

Add `allow_async?` flag to `compose` #22

Open zachdaniel opened 1 year ago

zachdaniel commented 1 year ago

We need a way to control whether or not composed reactors can do things asynchronously.

if allow_async? is true: If it is runtime composition, the reactor will be run in an async step. If it is compile time async, the steps produced will be allowed to be async.

if allow_async? is false: If it is runtime composition, the reactor will be run in a sync step, passing the async?: false option to the reactor. I fit is compile time composition, the steps produced will not be allowed to be async.

compose :create_another_thing, __MODULE__ do
  allow_async? false
end