Event driven application
Many applications listen to multiple event sources, update the state of corresponding business entities, and have to execute actions if some state is reached. Cadence is a good fit for many of these. It has direct support for asynchronous events (aka signals), has a simple programming model that obscures a lot of complexity around state persistence, and ensures external action execution through built-in retries.
Samples
Runnable event-driven samples:
| Sample | Description | Code |
|---|---|---|
| Signal handling | Workflow that waits for and reacts to external signals | Go · Java |
| Event accumulation | Counter workflow that accumulates signal events, like the loyalty-points example below | Go |
| Signal and response | Sends a signal to a workflow and reads back its response | Java |
Real-world examples:
- Fraud detection where workflow reacts to events generated by consumer behavior
- Customer loyalty program where the workflow accumulates reward points and applies them when requested