streams

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStreamNotFound = errors.New("stream could not be found")

Functions

This section is empty.

Types

type Stream

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

Stream provides a bidirectional communication channel between Olric nodes and clients. It can also be used for node-to-node communication.

func (*Stream) Close

func (s *Stream) Close()

Close calls s.cancel and stops all background goroutines.

func (*Stream) Done

func (s *Stream) Done() <-chan struct{}

func (*Stream) Write

func (s *Stream) Write(m protocol.EncodeDecoder)

type Streams

type Streams struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Streams maps StreamIDs to Stream

func New

func (*Streams) DeleteStreamByID

func (ss *Streams) DeleteStreamByID(id uint64)

func (*Streams) GetStreamByID

func (ss *Streams) GetStreamByID(id uint64) (*Stream, error)

func (*Streams) RegisterOperations

func (ss *Streams) RegisterOperations(operations map[protocol.OpCode]func(w, r protocol.EncodeDecoder))

func (*Streams) Shutdown

func (ss *Streams) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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