local

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSubscribed = errors.New("topic is not subscribed")

Functions

This section is empty.

Types

type Local

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

Local is a simple implementation of the transport.Transport interface using local channels.

func New

func New(ctx context.Context, b int, s map[string]transport.Message) *Local

New returns a new instance of the Local structure. The created transport can handle up to b unread messages before it is blocked. The list of supported subscriptions must be given as a map in s argument, where the key is the subscription's topic name, and the map value is the message type messages given as a nil pointer, e.g: (*Message)(nil).

func (*Local) Broadcast

func (l *Local) Broadcast(topic string, message transport.Message) error

Broadcast implements the transport.Transport interface.

func (*Local) Messages

func (l *Local) Messages(topic string) chan transport.ReceivedMessage

Messages implements the transport.Transport interface.

func (*Local) Start

func (l *Local) Start() error

Start implements the transport.Transport interface.

func (*Local) Wait

func (l *Local) Wait() chan error

Wait implements the transport.Transport interface.

Jump to

Keyboard shortcuts

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