wsserver

package
v0.0.0-...-b92263b Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrScheduleTimeout = fmt.Errorf("schedule error: timed out")

Functions

func StartEPollServer

func StartEPollServer(ctx context.Context, g *errgroup.Group, listenAddr string, poolSize int, registrar SessionRegistrar)

func StartSimpleServer

func StartSimpleServer(ctx context.Context, g *errgroup.Group, listenAddr string, registrar SessionRegistrar)

Types

type Pool

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

func NewPool

func NewPool(size int) *Pool

func (*Pool) Schedule

func (p *Pool) Schedule(task func())

func (*Pool) ScheduleTimeout

func (p *Pool) ScheduleTimeout(timeout time.Duration, task func()) error

type Session

type Session interface {
	Context() context.Context
	Close(err error)
	Write(msg proto.Message) error
	OnRead(f func(msg proto.Message) error)
}

type SessionRegistrar

type SessionRegistrar func(session Session)

Jump to

Keyboard shortcuts

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