public PoolFiber(Executor pool, BatchExecutor executor, ScheduledExecutorService scheduler) { _flushExecutor = pool; _commandExecutor = executor; _scheduler = new SchedulerImpl(this, scheduler); _flushRunnable = new Runnable() { public void run() { flush(); } }; }
public PoolFiberFactory(Executor exec) { this(exec, SchedulerImpl.createSchedulerThatIgnoresEventsAfterStop()); }
public Disposable schedule(Runnable command, long delay, TimeUnit unit) { return _scheduler.schedule(command, delay, unit); }
@Override public Disposable scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return scheduler.scheduleAtFixedRate(command, initialDelay, period, unit); }
@Override public Disposable scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return scheduler.scheduleWithFixedDelay(command, initialDelay, delay, unit); }
@Override public void dispose() { synchronized (_disposables) { //copy list to prevent concurrent mod for (Disposable r : _disposables.toArray(new Disposable[_disposables.size()])) { r.dispose(); } } scheduler.dispose(); execute(new Runnable() { @Override public void run() { selectorRunning = false; } }); }
@Override public Disposable scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return scheduler.scheduleAtFixedRate(command, initialDelay, period, unit); }
@Override public Disposable scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return scheduler.scheduleWithFixedDelay(command, initialDelay, delay, unit); }
@Override public void dispose() { synchronized (_disposables) { //copy list to prevent concurrent mod for (Disposable r : _disposables.toArray(new Disposable[_disposables.size()])) { r.dispose(); } } scheduler.dispose(); execute(new Runnable() { @Override public void run() { selectorRunning = false; } }); }
@Override public Disposable schedule(Runnable command, long delay, TimeUnit unit) { return scheduler.schedule(command, delay, unit); }
public PoolFiber(Executor pool, BatchExecutor executor, ScheduledExecutorService scheduler) { _flushExecutor = pool; _commandExecutor = executor; _scheduler = new SchedulerImpl(this, scheduler); _flushRunnable = new Runnable() { public void run() { flush(); } }; }
public SchedulerImpl(Executor queue){ this(queue, createSchedulerThatIgnoresEventsAfterStop()); }
public Disposable scheduleAtFixedRate(Runnable command, long initialDelay, long delay, TimeUnit unit) { return register(_scheduler.scheduleAtFixedRate(command, initialDelay, delay, unit)); }
public Disposable scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return register(_scheduler.scheduleWithFixedDelay(command, initialDelay, delay, unit)); }
@Override public Disposable schedule(Runnable command, long delay, TimeUnit unit) { return scheduler.schedule(command, delay, unit); }
public ThreadFiber(RunnableExecutor queue, String threadName, boolean isDaemonThread){ this(queue, threadName, isDaemonThread, new SchedulerImpl(queue)); }
public PoolFiberFactory(Executor exec) { this(exec, SchedulerImpl.createSchedulerThatIgnoresEventsAfterStop()); }
public Disposable scheduleAtFixedRate(Runnable command, long initialDelay, long delay, TimeUnit unit) { return register(_scheduler.scheduleAtFixedRate(command, initialDelay, delay, unit)); }
public Disposable scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return register(_scheduler.scheduleWithFixedDelay(command, initialDelay, delay, unit)); }
public Disposable schedule(Runnable command, long delay, TimeUnit unit) { return _scheduler.schedule(command, delay, unit); }