SwiftEventBus
SwiftEventBus copied to clipboard
How to send sticky events?
+1
post sticky is very useful plz add it
I don't have the time right now, can you please open a pull request?
@cesarferreira can you give a hint about the best way to add it to SwiftEventBus ? I will work on adding it
Some events carry information that is of interest after the event is posted. For example, an event signals that some initialization is complete. Or if you have some sensor or location data and you want to hold on the most recent values. Instead of implementing your own caching, you can use sticky events. So EventBus keeps the last sticky event of a certain type in memory. Then the sticky event can be delivered to subscribers or queried explicitly. Thus, you don’t need any special logic to consider already available data
You can see the java eventbus in this link : http://greenrobot.org/eventbus/documentation/configuration/sticky-events/