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>
This commit makes it so EventListener::listen() does not overwrite
existing listeners if they already exist. If the listener is already
registered in an event listener list, it removes the listener from that
list before registering the new listener. This soundness bug was missed
during #94.
This is a patch-compatible fix for #100. We may also want an API-level
fix for #100 as well. This is up for further discussion.
Signed-off-by: John Nunley <dev@notgull.net>
This commit adds WASM compilation support to this crate. The main thing
is that the wait() family of APIs are removed in WASM mode, as blocking
is not allowed in WASM.
In addition, tests are added to CI to support WASM.
Signed-off-by: John Nunley <dev@notgull.net>
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.
* Use slab to avoid unsafe code
* Move send+sync impls down to Mutex
* Code review
* Unwrap the key earlier
* Reduce the scope of one of the unsafe blocks.