bytebox - v1.0.0
    Preparing search index...

    Interface Scheduler

    interface Scheduler {
        imports: {
            kill(handle: number): void;
            offer(arg: unknown, callback: (arg: unknown) => void, due: number): number;
        };
        clear(): void;
        drain(options?: DrainOptions): DrainResult;
        drainAsync(options?: DrainOptions): Promise<DrainResult>;
        nextDue(): number;
        now(): number;
        pending(): number;
    }
    Index
    imports: {
        kill(handle: number): void;
        offer(arg: unknown, callback: (arg: unknown) => void, due: number): number;
    }

    Install as the module's teavmAsync import.

    • Milliseconds until the earliest queued fiber is due, or -1 when none are queued.

      Returns number

    • The clock the scheduler and the compiled program share.

      load installs this as teavmDate.currentTimeMillis, so System.currentTimeMillis() agrees with the scheduler about what time it is. Under virtual that makes a slept-through interval visible to Java rather than leaving its clock frozen behind the queue.

      Returns number