AbstractThe database type, defaults to <any, any> or {@code null}.
The client type, defaults to ICoreClient or {@code null}.
The cache type, defaults to ICoreCache or {@code null}.
The database type, defaults to <any, any> or {@code null}.
The client type, defaults to ICoreClient or {@code null}.
The cache type, defaults to ICoreCache or {@code null}.
ProtectedchannelAbstractloop
CoreLoopService is an abstract service that runs a periodic loop task.
Param: name
Unique identifier for the service instance.
Param: timeout
Interval in milliseconds between loop executions.
Param: module
The kernel module that supplies the service’s dependencies.
Param: skipAutoStart
If true, the service will not start automatically after construction.
Method
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.
Method
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.
Method
async next() Moves the service into a 'SLEEPING' state and then restarts it, ensuring the next loop iteration begins after the configured timeout.
Method
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.
Method
setRunning() Sets the internal state to 'RUNNING' unless a stop has been forced.
Method
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.