-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
Copy&pasting from the matrix channel to avoid repeating:
zeenix: this method takes an Event ref but doesn't actually setup the listener to listen to this event. This seems like a pretty big footgun
Saltbag: The only other option is to have it insert itself into the list on await, which has its own footguns. It can’t be set up in new since it needs to be pinned.
zeenix: it's just a very strange and unintuitive api now. I see multiple issues here:
EventListener
existing w/o listening is just strange. The name implies something that's listening.new
takes aEvent
ref but doesn't listen to the given event.- The footgun of awaiting a listener w/o calling listen on it. That state should not be allowed to ever exist.
If listening require pinning, that should always be implied then. That's the whole point of
EventListener
type. At the very least, new andEventListener
docs should document all these caveats well.
Metadata
Metadata
Assignees
Labels
No labels