@grandlinex/core
    Preparing search index...

    Class CoreLoopService<K, T, P, C, E>Abstract

    CoreLoopService is an abstract service that runs a periodic loop task.

    Unique identifier for the service instance.

    Interval in milliseconds between loop executions.

    The kernel module that supplies the service’s dependencies.

    If true, the service will not start automatically after construction.

    async start() Initiates the service loop. If the service is in the 'INIT' state, it schedules the first execution immediately; otherwise, it schedules subsequent executions based on the configured timeout. The method respects the forceStop flag to avoid restarting after a stop request.

    async startUp() Internal routine that transitions the service into a 'RUNNING' state and then executes the loop method. If a stop has been requested, it moves the service to a 'SLEEPING' state instead.

    async next() Moves the service into a 'SLEEPING' state and then restarts it, ensuring the next loop iteration begins after the configured timeout.

    async stop() Attempts to halt the service. It sets the forceStop flag and, depending on the current state, clears scheduled timers or waits briefly before retrying until the service is fully stopped.

    setRunning() Sets the internal state to 'RUNNING' unless a stop has been forced.

    setSleeping() Sets the internal state to 'SLEEPING'.

    async loop() Subclasses must implement this method to contain the logic that should execute on each loop cycle. The method is awaited by startUp.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    channel: string
    forceStop: boolean = false
    interval: Timeout | null
    logger: CoreLogger | null
    skipAutoStart: boolean
    state: ServiceStates = 'INIT'
    timeOut: number

    Methods