Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel is a websocket connection that messages are read from and written to.
func (*Channel) Send ¶
Send a message over the channel. Once write concurrency of the handler is reached this method will block.
func (*Channel) SetOnClose ¶
func (c *Channel) SetOnClose(callback func())
SetOnClose sets the callback to get called when the channel is closed.
type ChannelPool ¶
func NewChannelPool ¶
func NewChannelPool() *ChannelPool
func (*ChannelPool) Delete ¶
func (c *ChannelPool) Delete(id string)
func (*ChannelPool) Get ¶
func (c *ChannelPool) Get(id string) *Channel
func (*ChannelPool) Set ¶
func (c *ChannelPool) Set(id string, ch *Channel)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a high performance websocket handler that uses netpoll with read and write concurrency to allow a high number of concurrent websocket connections.
func NewHandler ¶
func NewHandler(callback RecievedCallback, channels *ChannelPool) (*Handler, error)
NewHandler creates a new websocket handler.
type RecievedCallback ¶
RecievedCallback is the signature for the callback called when a message is recieved on a Channel.
Click to show internal directories.
Click to hide internal directories.