File

src/ui/common/services/server-side-event-handler-queue.service.ts

Description

A service that manages the queue of all SSEH events, ensuring they are processed in order.

Index

Methods

Constructor

constructor(logger: SmartLoggerService)

Creates an instance of SmartServerSideEventHandlerQueueService.

Parameters :
Name Type Optional
logger SmartLoggerService No

Methods

Public cancelSession
cancelSession(sessionId: string)

Cancels pending events for a closed SSEH session.

Parameters :
Name Type Optional Description
sessionId string No

The session whose pending work should cancel.

Returns : void
Public getNextEventId
getNextEventId(sessionId?: string)

Gets the next available event ID from the queue and adds it to the queue.

Parameters :
Name Type Optional
sessionId string Yes
Returns : number

The next event ID.

Public processingComplete
processingComplete(eventId: number)

Signals that the event with the given ID has been processed.

Parameters :
Name Type Optional Description
eventId number No

The ID of the event that has been processed.

Returns : void
Public waitForMyTurn
waitForMyTurn(eventId: number)

Returns an observable that emits when it's the given event's turn to be processed.

Parameters :
Name Type Optional Description
eventId number No

The event ID to wait for.

Returns : any

An observable that emits when it's the event's turn.

Public waitForMyTurnResult
waitForMyTurnResult(eventId: number)

Returns an observable that emits a queue turn for the given event.

Parameters :
Name Type Optional Description
eventId number No

The event ID to wait for.

Returns : any

The queue turn.

results matching ""

    No results matching ""