use of net.dempsy.util.executor.AutoDisposeSingleThreadScheduler in project Dempsy by Dempsy.
the class NodeManager method getThePlug.
@Override
public ThePlug getThePlug() {
return () -> {
try {
// we are going to go down no matter what!
final var scheduler = new AutoDisposeSingleThreadScheduler("shutdown-timer");
scheduler.schedule(() -> {
try {
LOGGER.error("Shutdown timer triggered. Hard exiting!");
ignore(() -> Thread.sleep(200));
} finally {
System.exit(1);
}
}, 30, TimeUnit.SECONDS);
stop();
} catch (final Throwable th) {
try {
LOGGER.error("Failed shutting down!", th);
ignore(() -> Thread.sleep(200));
} finally {
System.exit(1);
}
}
};
}
use of net.dempsy.util.executor.AutoDisposeSingleThreadScheduler in project Dempsy by Dempsy.
the class TestSimpleRoutingStrategy method setup.
@Before
public void setup() {
sessFact = new LocalClusterSessionFactory();
session = sessFact.createSession();
sched = new AutoDisposeSingleThreadScheduler("test");
infra = makeInfra(session, sched);
}
use of net.dempsy.util.executor.AutoDisposeSingleThreadScheduler in project Dempsy by Dempsy.
the class BaseRouterTestWithSession method setup.
@Before
public void setup() throws ClusterInfoException, IOException {
session = sessFact.createSession();
sched = new AutoDisposeSingleThreadScheduler(testName + "-AutoDisposeSingleThreadScheduler");
infra = makeInfra(session, sched);
}
Aggregations