first short-circuits event completion once the first successful non-None / non-undefined result is available.
Lifecycle impact
- The first successful result wins (
None/undefinedand errors do not win). - In
serialhandler mode, remaining handlers are skipped once a winner appears. - In
parallelhandler mode, in-flight losers are cancelled or aborted. - Event completion resolves as soon as a winner is found (or all handlers fail).
Execution order example
- Python
- TypeScript
- Go
- Rust
Notes
- This mode is useful for fallback chains and race-to-first-response patterns.
- Use
await event.now(first_result=True)/await event.now({ first_result: true })/event.Now(&abxbus.EventWaitOptions{FirstResult: true})/event.now_with_options(EventWaitOptions { first_result: true, ..Default::default() })when you want to resolve as soon as a valid result is available while still allowing all handlers to continue. To stop running after the first valid handler result, setevent_handler_completion: 'first'on the event definition.