specification icon indicating copy to clipboard operation
specification copied to clipboard

Add a new `until` (optional) property to Event Consumption Strategies of type `any`

Open cdavernas opened this issue 1 year ago • 0 comments

What would you like to be added:

Add a new until (optional) property to Event Consumption Strategies of type any

Why is this needed:

Allows authors to define streaming-like event listeners, that would listen to events until a specific condition is met or until specific events are consumed.

My proposal would allow doing the following:

Listen to specific events until a runtime expression condition is met:

listen:
  to:
    any: #if no event is defined, all incoming events are matched
      - type: event1
      - type: event2
    until: $context.finishedConsumingEvents

Listen to specific events until the defined event(s) are consumed:

listen:
  to:
    any: {}
  until:
    one:
      with:
        type: io.serverlessworkflow.examples.events.end-listening.v2

cdavernas avatar Aug 25 '24 13:08 cdavernas