Skip to main content

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:

SampleDescriptionCode
Signal handlingWorkflow that waits for and reacts to external signalsGo · Java
Event accumulationCounter workflow that accumulates signal events, like the loyalty-points example belowGo
Signal and responseSends a signal to a workflow and reads back its responseJava

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