@Override
    public <T> void onCompletion(Future<T> work, CompletionListener<T> l) {
        boolean queue = true;

        FutureMonitorInfo<T> info = new FutureMonitorInfo<T>(work, l);

        if (info.test()) {
            queue = !!!info.notifyListener();
        }

        if (queue && work instanceof NonCancelableResultFuture<?>) {
            ((NonCancelableResultFuture<T>) work).queueListener(l);
            queue = false;
        }

        if (queue) {
            _monitor.add(info);
            if (_threadRunning.compareAndSet(false, true)) {
                // run thread
                _executor.schedule(_thread, 100, TimeUnit.MILLISECONDS);
            }
        }
    }
@ Override public < T > void onCompletion ( Future < T > work , CompletionListener < T > l ) { boolean queue = true ; FutureMonitorInfo < T > info = new FutureMonitorInfo < T > ( work , l ) ; if ( info . test ( ) ) { queue = ! ! ! info . notifyListener ( ) ; } if ( queue && work instanceof NonCancelableResultFuture < ? > ) { ( ( NonCancelableResultFuture < T > ) work ) . queueListener ( l ) ; queue = false ; } if ( queue ) { _monitor . add ( info ) ; if ( _threadRunning . compareAndSet ( false , true ) ) { _executor . schedule ( _thread , 100 , TimeUnit . MILLISECONDS ) ; } } }
{@inheritDoc}