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
Notes
- This mode is useful for fallback chains and race-to-first-response patterns.
await event.first()also forces this mode for that event at call time.