Skip to content
This repository has been archived by the owner on May 23, 2020. It is now read-only.

Add firehose listener #18

Closed
dlew opened this issue Nov 13, 2015 · 0 comments
Closed

Add firehose listener #18

dlew opened this issue Nov 13, 2015 · 0 comments

Comments

@dlew
Copy link
Contributor

dlew commented Nov 13, 2015

This issue is more to remind myself of my own thoughts...

I've been thinking about the possibility of a firehose listener, i.e. one that gets every event. The advantage of it would be in cases where you need to listen to a whole bunch of events at once (for example RxLifecycle would put it to good use).

I think it can be wrapped into the existing Event<T> architecture if we add some sort of Firehose<Type, Object>. Then you'd register Event<Firehose<Type, Object>>, which would allow you to filter on Type and then use the provided Object. We'll necessarily lose some type safety on the firehose (since it has to emit any type of Object) but that will be the price you pay for it.

An alternative would be to just have Event<Type> and say that the firehose listener doesn't actually pass objects. This might be preferable since then we can avoid unnecessary object creation (i.e. on events that no one actually cares about and are filtering out in the firehose).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant