Import std.events.event
std.events.event
Event<T>: the handlers that an Emit calls, in the order they were added, held as a Field of
what emits it, which holds them until they're cancelled. Subscribe gives a Subscription, whose
Cancel takes its handler off; a handler subscribed for an owner, which it holds weakly, also
goes once the owner does. An Event and its Subscriptions stay on the thread that made them, as a
Class's objects do.
std/events/event.fb
Types
Event
class
Public Class Event<T>
The handlers that an Emit calls with its value, in the order they were added.
-
A new Event, with no handlers.
-
How many handlers it has: those not cancelled, whose owners, if they have them, are there.
-
Adds
handler, which each Emit after this calls, after the handlers added before it, until the Subscription it gives is cancelled. An Emit that's calling handlers meanwhile doesn't. -
Adds
handlerforowner, which it's called with, after the handlers added before it, until the Subscription it gives is cancelled or theownergoes, as thehandlerholds it weakly. Thehandlergets theowner, so it needn't capture it, which would keep it: a handler that captures its owner keeps it as long as the Event keeps thehandler. The next Emit or Clear after theownergoes takes thehandlerout, as a Subscribe does now and then. -
Calls each handler with
value, in the order they were added. A handler added meanwhile waits for the next Emit, and one cancelled meanwhile, by a handler before it, isn't called. -
Takes every handler off, as their Subscriptions' Cancel would, and out at once at the end, as an Emit does.
Subscription
class
Public Class Subscription
A handler's place on an Event, which Cancel takes it off. It holds neither the Event nor the handler, so keeping one keeps neither.
-
Takes the handler off its Event, so no Emit after calls it, and lets go of it. Cancelling it again, or once the Event has gone, does nothing.
-
Whether the handler is still on its Event.
Report an issue with this page or with FutureBlitz on GitHub.