Commit Graph

8 Commits

Author SHA1 Message Date
John Nunley 6e6202b3f1 chore: Polish the implementation of the new API
* Make sure Unpin is implemented for StackListener
* Purge the prelude
* Remove unused imports from doctests

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-03 09:49:22 -08:00
John Nunley d9144a8a41 feat: Create Listener trait
This commit creates the Listener trait and moves most of EventListener's
functionality to that trait.

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-03 09:49:22 -08:00
John Nunley 86b778074c feat: Move EventListener back onto the heap
Minimal amount of changes to make EventListener a heap-allocated type
again. The existence of the EventListener implies that it is already
listening; accordingly the new() and listen() methods on EventListener
have been removed.

cc #104

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-03 09:49:22 -08:00
John Nunley 21b34bf6dd
breaking: Fix the EventListener::new() footgun
This is a breaking change. It makes `new()` take no parameters in its
signature and `listen()` take a reference to an event in its signature.
This should avoid a footgun where a listener can be waited on without
listening on it.

Closes #91

Signed-off-by: John Nunley <dev@notgull.net>
2023-11-15 06:01:17 -08:00
jtnunley 17952d648e Fix code review/CI issues 2023-03-31 13:58:16 -07:00
jtnunley bc07d43403 Avoid allocation in the benchmarks 2023-03-31 13:43:53 -07:00
jtnunley 996ee4d4f9 EventListener is now used through pinning
The EventListener for the upcoming libstd-based implementation needs to
be pinned, so this commit sets up the infrastructure for the pinned
EventListener.

This is a breaking change.
2023-03-31 13:19:06 -07:00
John Nunley 5c1ae634fb
Add basic benchmarks (#31) 2022-09-09 07:30:51 -07:00