find(...) is the unified lookup API: search history, wait for future events, or combine both.
Interface
- Python
- TypeScript
- Go
- Rust
Option semantics
pasttrue: search all history (default)false: skip historynumber(ortimedeltain Python): search recent history window
futurefalse: do not wait (default)true: wait indefinitelynumber: wait up to N seconds
where: predicate filterchild_of: match only descendants of the given parent eventevent_fields: strict equality filters on event fields/metadata
past=True, future=False).
Common use cases
1) History lookup only (non-blocking)
- Python
- TypeScript
- Go
- Rust
2) Wait only for future events
- Python
- TypeScript
- Go
- Rust
3) Check recent history, then keep waiting briefly
- Python
- TypeScript
- Go
- Rust
4) Filter by fields + predicate
- Python
- TypeScript
- Go
- Rust
5) Wildcard lookup across all event types
- Python
- TypeScript
- Go
- Rust
6) Find descendants of a specific parent event
- Python
- TypeScript
- Go
- Rust
7) Debounce expensive work
- Python
- TypeScript
- Go
- Rust
Important behavior
find()resolves when an event is emitted, not when handlers finish.- To wait for handler completion, call
await event.now()in Python/TypeScript,event.Now()in Go, orevent.now().awaitin Rust. - If no match is found (or
futuretimes out),find()returnsNone/null. - If both
pastandfuturearefalse, it returns immediately with no match.
Returning multiple matches: filter()
filter() takes the same arguments as find() but returns the list of all matching events
(ordered newest to oldest), plus an optional limit argument to cap the number of results.
find() is equivalent to filter(..., limit=1) returning the first match (or None / null).
- Python
- TypeScript
- Go
- Rust