Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNilConfig = errors.New("websocket async notifier config is nil")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
HeartbeatInterval time.Duration `env:"HEARTBEAT_INTERVAL" json:"heartbeatInterval"`
ReadBufferSize int `env:"READ_BUFFER_SIZE" json:"readBufferSize"`
WriteBufferSize int `env:"WRITE_BUFFER_SIZE" json:"writeBufferSize"`
}
Config holds WebSocket async notifier configuration.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier is a WebSocket-backed AsyncNotifier that manages direct client connections.
func NewNotifier ¶
func NewNotifier(cfg *Config, logger logging.Logger, tracerProvider tracing.TracerProvider) (*Notifier, error)
NewNotifier creates a new WebSocket-backed AsyncNotifier.
func (*Notifier) AcceptConnection ¶
func (n *Notifier) AcceptConnection(w http.ResponseWriter, r *http.Request, channel, memberID string) error
AcceptConnection upgrades the HTTP connection to a WebSocket and registers it under the given channel and memberID.
Click to show internal directories.
Click to hide internal directories.