internal

package
v0.0.0-...-91c9646 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(rdb *redis.Client) *Manager

NewManager builds one hub per CPU for WS fanout.

func (*Manager) ServeWS

func (m *Manager) ServeWS(w http.ResponseWriter, r *http.Request)

ServeWS upgrades to WS and binds each client to one hub. Also starts RW pumps per client.

func (*Manager) Start

func (m *Manager) Start(parent context.Context)

Start launches each hub loop and Redis subscriber worker.

func (*Manager) Stop

func (m *Manager) Stop()

func (*Manager) Wait

func (m *Manager) Wait()

type Message

type Message struct {
	ID       string          `json:"id"`
	ServerID string          `json:"server_id"`
	Username string          `json:"username"`
	Payload  json.RawMessage `json:"payload"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL