network

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubscriptionTypeConection = "connection"
	Connected                 = "connected"
	Disconnected              = "disconnected"
)

SubscriptionTypeConection for use by other go routines

Variables

This section is empty.

Functions

This section is empty.

Types

type Networker

type Networker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Networker network worker

func NewNetworker

func NewNetworker(workers *worker.Workers, id int, label string) *Networker

NewNetworker create a new Networker

func (*Networker) Command

func (w *Networker) Command(c int)

Command sent to this worker

func (*Networker) Data

func (w *Networker) Data(d []byte)

Data sent to this worker

func (*Networker) Disconnect

func (w *Networker) Disconnect()

Disconnect the websocket

func (*Networker) ID added in v0.2.0

func (w *Networker) ID() int

ID return label of worker

func (*Networker) Label added in v0.2.0

func (w *Networker) Label() string

Label return label of worker

func (*Networker) Run

func (w *Networker) Run(wg *sync.WaitGroup, term *chan int)

Run is main finction of this worker

func (*Networker) Subscribe

func (w *Networker) Subscribe(id int, sType string, label string) *worker.Subscription

Subscribe to this worker

func (*Networker) Subscriptions added in v0.2.0

func (w *Networker) Subscriptions() []*worker.Subscription

Subscriptions return a copy of current scubscriptions

func (*Networker) Terminate

func (w *Networker) Terminate()

Terminate the worker

func (*Networker) UnSubscribe

func (w *Networker) UnSubscribe(id int, sType string)

UnSubscribe from this worker

Jump to

Keyboard shortcuts

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