use of com.mongodb.internal.thread.DaemonThreadFactory in project mongo-java-driver by mongodb.
the class Mongo method createCursorCleaningService.
private ExecutorService createCursorCleaningService() {
ScheduledExecutorService newTimer = Executors.newSingleThreadScheduledExecutor(new DaemonThreadFactory("CleanCursors"));
newTimer.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
cleanCursors();
}
}, 1, 1, SECONDS);
return newTimer;
}
use of com.mongodb.internal.thread.DaemonThreadFactory in project mongo-java-driver by mongodb.
the class DefaultConnectionPool method createMaintenanceTimer.
private ExecutorService createMaintenanceTimer() {
if (maintenanceTask == null) {
return null;
} else {
ScheduledExecutorService newTimer = Executors.newSingleThreadScheduledExecutor(new DaemonThreadFactory("MaintenanceTimer"));
newTimer.scheduleAtFixedRate(maintenanceTask, settings.getMaintenanceInitialDelay(MILLISECONDS), settings.getMaintenanceFrequency(MILLISECONDS), MILLISECONDS);
return newTimer;
}
}
use of com.mongodb.internal.thread.DaemonThreadFactory in project mongo-java-driver by mongodb.
the class MongoClient method createCursorCleaningService.
private ExecutorService createCursorCleaningService() {
ScheduledExecutorService newTimer = Executors.newSingleThreadScheduledExecutor(new DaemonThreadFactory("CleanCursors"));
newTimer.scheduleAtFixedRate(this::cleanCursors, 1, 1, SECONDS);
return newTimer;
}
Aggregations