public Disposable subscribeOnProducerThread(final DisposingExecutor queue, final Callback<T> callbackOnQueue) { Disposable unSub = new Disposable() { public void dispose() { remove(callbackOnQueue); queue.remove(this); } }; queue.add(unSub); //finally add subscription to start receiving events. _subscribers.add(callbackOnQueue); return unSub; }
/** * Receives the event and queues the execution on the target execute. */ @Override protected void onMessageOnProducerThread(final T msg) { Runnable asyncExec = new Runnable() { public void run() { _receiveMethod.onMessage(msg); } @Override public String toString() { return _receiveMethod.toString() + "(" + msg + ")"; } }; getQueue().execute(asyncExec); } }
public Disposable subscribeOnProducerThread(final DisposingExecutor queue, final Callback<T> callbackOnQueue) { Disposable unSub = new Disposable() { public void dispose() { remove(callbackOnQueue); queue.remove(this); } }; queue.add(unSub); //finally add subscription to start receiving events. _subscribers.add(callbackOnQueue); return unSub; }
/** * Receives the event and queues the execution on the target execute. */ @Override protected void onMessageOnProducerThread(final T msg) { Runnable asyncExec = new Runnable() { public void run() { _receiveMethod.onMessage(msg); } @Override public String toString() { return _receiveMethod.toString() + "(" + msg + ")"; } }; getQueue().execute(asyncExec); } }