Package org.greenrobot.eventbus.util
Class AsyncExecutor
- java.lang.Object
-
- org.greenrobot.eventbus.util.AsyncExecutor
-
public class AsyncExecutor extends java.lang.ObjectExecutes anAsyncExecutor.RunnableExusing a thread pool. Thrown exceptions are propagated by posting failure events. By default, usesThrowableFailureEvent.Set a custom event type using
AsyncExecutor.Builder.failureEventType(Class). The failure event class must have a constructor with one parameter of typeThrowable. If using ProGuard or R8 make sure the constructor of the failure event class is kept, it is accessed via reflection. E.g. add a rule like-keepclassmembers class com.example.CustomThrowableFailureEvent { <init>(java.lang.Throwable); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAsyncExecutor.Builderstatic interfaceAsyncExecutor.RunnableExLikeRunnable, but the run method may throw an exception.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AsyncExecutor.Builderbuilder()static AsyncExecutorcreate()voidexecute(AsyncExecutor.RunnableEx runnable)Posts an failure event if the givenAsyncExecutor.RunnableExthrows an Exception.
-
-
-
Method Detail
-
builder
public static AsyncExecutor.Builder builder()
-
create
public static AsyncExecutor create()
-
execute
public void execute(AsyncExecutor.RunnableEx runnable)
Posts an failure event if the givenAsyncExecutor.RunnableExthrows an Exception.
-
-