Re: Better event listeners

On 16/03/13 14:20, brandon.wallace@yahoo.com wrote:
> As an author, I very rarely need to subscribe to a single occurrence of an event.  The vastly more common case is to subscribe to a stream of events until some condition is met, then unsubscribe from the stream.
> 
> Since a future represents a single occurrence of an event, it can really only be used in the rare case, but not in the common multi-occurrence case.  But then I would have to choose to use a different API (Futures) for this rare case.  Why would I do that, when I could instead use the common streaming API and just unsubscribe when the event occurs?

I agree with Brandon, given that Future can only apply with something
like .once(), I doubt it is really useful to try to include Future here
because part of the API would be using the traditional callbacks and
another part would be using Future. The inconsistency doesn't seem to be
worth it.

--
Mounir

Received on Wednesday, 27 March 2013 17:55:21 UTC