Query Task Status
The JobStatusChecker is designed to monitor the status of asynchronous jobs through a WebSocket connection.
The status channel is based on Socket.IO instead of standard WebSocket.
Workflow
Initialization: Establish a WebSocket connection to the server using the
base_url
andsubscription_key
.Request Handling:
On a successful connection, initiate status queries with the specified job with its
uuid
.
Status Monitoring:
Periodically send status queries to the server, we recommend submitting queries at 2-second intervals.
Listen for responses from the server and update the job status accordingly.
If the job is completed successfully, perform necessary cleanup actions such as closing the connection.
API Endpoint
Socket
/api/scheduler_socket
Queries
subscription
subscripton_key
Sending a Query
To query the status of a job, send a message to the scheduler socket endpoint with the job's UUID:
Receiving a Response
The server responds with the status of the job, including details such as the job's UUID, status, and any relevant metrics.
While the specific implementation can vary, the core functionality typically involves:
A WebSocket client that handles the lifecycle of the connection and communication.
Event handlers that react to changes in the connection status and incoming messages.
A mechanism to periodically send requests to the server to check the status of the job.
Examples
Last updated