Documentation
¶
Index ¶
- Constants
- func KindFromTopic(topic string) string
- type Client
- type Hub
- func (h *Hub) BroadcastAll(message []byte)
- func (h *Hub) BroadcastToWorkflow(workflowID string, message []byte)
- func (h *Hub) CloseTopic(topic string)
- func (h *Hub) NewClient(conn *websocket.Conn, workflowID string) *Client
- func (h *Hub) Run()
- func (h *Hub) WorkflowSubscriberCount(workflowID string) int
Constants ¶
View Source
const ( KindCanvas = "canvas" KindAgent = "agent" KindFactory = "factory" KindUser = "user" KindPublic = "public" // AgentSessionTopicPrefix is shared with eventdistributer topic keys. AgentSessionTopicPrefix = "agent-session:" // FactoryTopicPrefix is shared with eventdistributer topic keys. FactoryTopicPrefix = "factory:" // UserTopicPrefix is shared with eventdistributer topic keys. UserTopicPrefix = "user:" // PublicLineTopicPrefix is the guest board socket. It carries no order payload. PublicLineTopicPrefix = "public-line:" )
Variables ¶
This section is empty.
Functions ¶
func KindFromTopic ¶
KindFromTopic maps a hub subscription key to a low-cardinality kind label.
Types ¶
type Client ¶
type Client struct {
Done chan struct{}
// contains filtered or unexported fields
}
Client represents a connected websocket client
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to them
func (*Hub) BroadcastAll ¶
BroadcastAll sends a message to all connected clients
func (*Hub) BroadcastToWorkflow ¶
func (*Hub) CloseTopic ¶
CloseTopic drops every client on a topic. The write pump closes the socket.
func (*Hub) WorkflowSubscriberCount ¶ added in v0.21.0
Click to show internal directories.
Click to hide internal directories.