if (action != null && action.type() == Action.TYPE.SUSPEND && action.timeout() != -1) {
final AtomicReference<Future<?>> f = new AtomicReference<Future<?>>();
f.set(suspendTimer.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
if (!w.isClosed() && (System.currentTimeMillis() - w.lastTick()) > action.timeout()) {
asynchronousProcessor.endRequest(impl, false);
f.get().cancel(true);
}
}
}, action.timeout(), action.timeout(), TimeUnit.MILLISECONDS));