final < Output > int runAsync ( @ NonNull final ChronosOperation < Output > operation , final boolean broadcastResult ) { final ChronosOperationResult < Output > result = createEmptyResult ( operation , broadcastResult ) ; final int id = result . getId ( ) ; synchronized ( ChronosService . this ) { RunningOperationStorage . getInstance ( ) . operationStarted ( id , operation , mExecutorService . submit ( new Runnable ( ) { @ Override public void run ( ) { silentRun ( operation , result ) ; mEventBus . post ( result ) ; synchronized ( ChronosService . this ) { RunningOperationStorage . getInstance ( ) . operationFinished ( id ) ; } } } ) ) ; } return id ; }
Runs operation in background .