Skip to content

Conversation

@missytake
Copy link
Contributor

This commit also makes testing hooks easier, as it allows to process events and run hooks on them, until a certain event occurs.

This commit also makes testing hooks easier, as it allows to process events and
run hooks on them, until a certain event occurs.
until_func: Callable[[AttrDict], bool],
until_event: EventType = False,
) -> AttrDict:
"""Process events until the given callable evaluates to True.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation needs to be updated

self._process_messages()

stop = func(event)
if event.kind == until_event:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe do this check after calling until_func? Calling it one more time may be useful, e.g. for logging purposes, and it even goes before until_event in the _process_events() parameter list

@missytake missytake requested a review from iequidoo January 14, 2026 15:25
Co-authored-by: iequidoo <117991069+iequidoo@users.noreply.github.com>
@missytake missytake merged commit 47b49fd into main Jan 14, 2026
30 checks passed
@missytake missytake deleted the run-until-rpc branch January 14, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants