/** * Run a notifier. Implementors will run the notifier, preferably in another thread. The default implementation * runs the notifier using the {@code Executor} retrieved via {@link #getNotifierExecutor()}. * * @param runnable the runnable task */ protected void runNotifier(final Runnable runnable) { getNotifierExecutor().execute(runnable); }
/** * {@inheritDoc} */ public <A> IoFuture<T> addNotifier(final Notifier<? super T, A> notifier, final A attachment) { State<T> oldState, newState; do { oldState = getState(); newState = oldState.withNotifier(getNotifierExecutor(), this, notifier, attachment); } while (! compareAndSetState(oldState, newState)); return this; }
/** * Run a notifier. Implementors will run the notifier, preferably in another thread. The default implementation * runs the notifier using the {@code Executor} retrieved via {@link #getNotifierExecutor()}. * * @param runnable the runnable task */ protected void runNotifier(final Runnable runnable) { getNotifierExecutor().execute(runnable); }
/** * {@inheritDoc} */ public <A> IoFuture<T> addNotifier(final Notifier<? super T, A> notifier, final A attachment) { State<T> oldState, newState; do { oldState = getState(); newState = oldState.withNotifier(getNotifierExecutor(), this, notifier, attachment); } while (! compareAndSetState(oldState, newState)); return this; }