Invoking a service when an event occurs #4817
-
|
Is there a method to trigger services when an event occurs? From my understanding of the docs, services (actors in v5) are used to run side effects functions or essentially handle actions and their results confined within the context of a state. I want to call a service during a transition in response to an event, without introducing a new state and returning to the previous state, or creating a new actor machine only to execute the service. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You can spawn actors instead of invoking them based on an event. 📖 Docs: https://stately.ai/docs/spawn |
Beta Was this translation helpful? Give feedback.
You can spawn actors instead of invoking them based on an event.
📖 Docs: https://stately.ai/docs/spawn