mirror of
https://github.com/coder/coder.git
synced 2026-10-24 01:26:25 +08:00
feat(site): use websocket connection for devcontainer updates (#18808)
Instead of polling every 10 seconds, we instead use a WebSocket connection for more timely updates.
This commit is contained in:
@@ -129,6 +129,14 @@ export const watchWorkspace = (
|
||||
});
|
||||
};
|
||||
|
||||
export const watchAgentContainers = (
|
||||
agentId: string,
|
||||
): OneWayWebSocket<TypesGen.WorkspaceAgentListContainersResponse> => {
|
||||
return new OneWayWebSocket({
|
||||
apiRoute: `/api/v2/workspaceagents/${agentId}/containers/watch`,
|
||||
});
|
||||
};
|
||||
|
||||
type WatchInboxNotificationsParams = Readonly<{
|
||||
read_status?: "read" | "unread" | "all";
|
||||
}>;
|
||||
|
||||
Reference in New Issue
Block a user