Documentation
¶
Index ¶
- Variables
- type Dispatcher
- func (d *Dispatcher) AddWSClient(sessionID string, conn *websocket.Conn)
- func (d *Dispatcher) CloseSession(sessionID string)
- func (d *Dispatcher) Emit(sessionID, event string, data any)
- func (d *Dispatcher) RemoveWSClient(sessionID string, conn *websocket.Conn)
- func (d *Dispatcher) StartRetryWorker()
- type Event
- type Queue
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(cfg *config.Config) *Dispatcher
func (*Dispatcher) AddWSClient ¶
func (d *Dispatcher) AddWSClient(sessionID string, conn *websocket.Conn)
AddWSClient registers websocket connection for session.
func (*Dispatcher) CloseSession ¶
func (d *Dispatcher) CloseSession(sessionID string)
CloseSession closes all websocket connections for session.
func (*Dispatcher) Emit ¶
func (d *Dispatcher) Emit(sessionID, event string, data any)
func (*Dispatcher) RemoveWSClient ¶
func (d *Dispatcher) RemoveWSClient(sessionID string, conn *websocket.Conn)
RemoveWSClient removes websocket connection.
func (*Dispatcher) StartRetryWorker ¶ added in v1.3.0
func (d *Dispatcher) StartRetryWorker()
StartRetryWorker periodically retries queued events.
Click to show internal directories.
Click to hide internal directories.