public void notifyAt(long time) {
        SchedulerState state = stateHolder.getState();
        try {
            // Insert the time into the queue
            state.toNotifyQueue.put(time);
            schedule(time, state, false);     // Let the subclasses to schedule the scheduler
        } catch (InterruptedException e) {
            // InterruptedException ignored if scheduledExecutorService has already been shutdown
            if (!scheduledExecutorService.isShutdown()) {
                log.error("Error when adding time:" + time + " to toNotifyQueue at Scheduler", e);
            }
        } finally {
            stateHolder.returnState(state);
        }
    }
Scheduler implementation to take periodic snapshots
modules/siddhi-core/src/main/java/io/siddhi/core/util/Scheduler.java