Warning: session_start(): open(/var/lib/php/sessions/sess_ac7q8a7ct2jckmlhiiqplpik87, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
scope jdk_watchService_start.
static new Flag #started;
static new MultiMap #listeners;
static #interval; // larger interval helps show less duplicate events (https://stackoverflow.com/questions/16777869/java-7-watchservice-ignoring-multiple-occurrences-of-the-same-event/34818620#34818620)
static WatchService jdk_watchService_start() {
final WatchService service = jdk_defaultWatchService();
if (started.raise()) thread "Watch Service" {
while licensed {
WatchKey key = service.poll(10, TimeUnit.SECONDS);
if (key != null) {
Path dir = cast key.watchable();
sleep(interval);
for (WatchEvent> event : key.pollEvents()) pcall {
final Path changed = (Path) event.context();
File full = newFile(dir.toFile(), changed.toFile().getPath());
//print("WatchService Changed: " + full + ", " + event.kind());
pcallFAll(listeners.get(key), full);
}
key.reset();
}
}
}
ret service;
}
end scope