You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another example is to fail when a subscriber throws an exception. Note: by default, EventBus catches exceptions thrown from onEvent methods and sends an SubscriberExceptionEvent that may but do not have to be handled.
116
+
Another example is to fail when a subscriber throws an exception. Note: by default, EventBus catches exceptions thrown from onEvent methods and sends a SubscriberExceptionEvent that may but do not have to be handled.
@@ -122,7 +122,7 @@ Another example is to fail when a subscriber throws an exception. Note: by defau
122
122
Check the EventBusBuilder class and its JavaDoc for all possible configuration possibilities.
123
123
124
124
### Configure the default EventBus instance ###
125
-
Using EventBus.getDefault() is a simple way to get an shared EventBus instance. EventBusBuilder also allows to configure this default instance using the method <code>installDefaultEventBus()</code>.
125
+
Using EventBus.getDefault() is a simple way to get a shared EventBus instance. EventBusBuilder also allows to configure this default instance using the method <code>installDefaultEventBus()</code>.
126
126
127
127
For example, it's possible to configure the default EventBus instance to rethrow exceptions, which occurred in onEvent methods. But let's to this only for DEBUG builds, because this will likely crash the app on exceptions:
128
128
@@ -152,7 +152,7 @@ Sticky Events
152
152
-------------
153
153
Some events carry information that is of interest after the event is posted. For example, this could be an event signalizing 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. EventBus keeps the last sticky event of a certain type in memory. The sticky event can be delivered to subscribers or queried explicitly. Thus, you don't need any special logic to consider already available data.
154
154
155
-
Let's say, an sticky event was posted some time ago:
155
+
Let's say, a sticky event was posted some time ago:
If you want to customize your AsyncExecutor instance, call the static method AsyncExecutor.builder().It will return a builder which lets you customize the EventBus instance, the thread pool, and the classof the failure event.
241
241
242
-
Another customization options is the execution scope, which gives failure events context information. For example, an failure event may be relevant only to a specific Activity instance or class. If your custom failure event classimplements the HasExecutionScope interface, AsyncExecutor will set the execution scope automatically. Like this, your subscriber can query the failure event for its execution scope and react depending on it.
242
+
Another customization options is the execution scope, which gives failure events context information. For example, a failure event may be relevant only to a specific Activity instance or class. If your custom failure event classimplements the HasExecutionScope interface, AsyncExecutor will set the execution scope automatically. Like this, your subscriber can query the failure event for its execution scope and react depending on it.
0 commit comments