worker

package
Version: v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeConnectionRequest added in v2.6.0

func MakeConnectionRequest(conf worker.Worker, address string) (string, error)

func New

func New(conf worker.Config) (services service.Group)

func NewHTTPServer added in v2.6.0

func NewHTTPServer(conf worker.Config) (*httpx.Server, error)

Types

type CoordinatorClient

type CoordinatorClient struct {
	*cws.Client
}

CoordinatorClient maintains connection to coordinator. We expect only one CoordinatorClient for each server.

func NewCoordinatorClient

func NewCoordinatorClient(oc *websocket.Conn) *CoordinatorClient

NewCoordinatorClient returns a client connecting to coordinator for coordination between different server.

type Handler

type Handler struct {
	service.RunnableService
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(conf worker.Config, address string) *Handler

NewHandler returns a new server

func (*Handler) Close

func (h *Handler) Close()

func (*Handler) GetCoordinatorClient

func (h *Handler) GetCoordinatorClient() *CoordinatorClient

func (*Handler) Prepare added in v2.4.0

func (h *Handler) Prepare()

func (*Handler) Run

func (h *Handler) Run()

Run starts a Handler running logic

func (*Handler) Shutdown added in v2.6.0

func (h *Handler) Shutdown(context.Context) error

type Session

type Session struct {
	ID string

	// Should I make direct reference
	RoomID string
	// contains filtered or unexported fields
}

Session represents a session connected from the browser to the current server It requires one connection to browser and one connection to the coordinator connection to browser is 1-1. connection to coordinator is n - 1 Peerconnection can be from other server to ensure better latency

func (*Session) Close

func (s *Session) Close()

Close close a session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL