broadcasts

package
v0.0.0-...-77d204d Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package broadcasts implements custom typed one-to-n facilities for broadcasting messages/calls to multiple subscribers. They loosely follow from luigi.Broadcasts but using concrete types instead of empty interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAttendantsEmitter

func NewAttendantsEmitter() (AttendantsEmitter, *AttendantsBroadcast)

NewAttendantsEmitter returns the Sink, to write to the broadcaster, and the new broadcast instance.

func NewEndpointsEmitter

func NewEndpointsEmitter() (EndpointsEmitter, *EndpointsBroadcast)

NewEndpointsEmitter returns the Sink, to write to the broadcaster, and the new broadcast instance.

Types

type AttendantsBroadcast

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

AttendantsBroadcast is an interface for registering one or more Sinks to recieve updates.

func (*AttendantsBroadcast) Register

func (bcst *AttendantsBroadcast) Register(sink AttendantsEmitter) func()

Register a Sink for updates to be sent. also returns

type AttendantsEmitter

type AttendantsEmitter interface {
	Joined(member refs.FeedRef) error
	Left(member refs.FeedRef) error

	io.Closer
}

type EndpointsBroadcast

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

EndpointsBroadcast is an interface for registering one or more Sinks to recieve updates.

func (*EndpointsBroadcast) Register

func (bcst *EndpointsBroadcast) Register(sink EndpointsEmitter) func()

Register a Sink for updates to be sent. also returns

type EndpointsEmitter

type EndpointsEmitter interface {
	Update(members []string) error
	io.Closer
}

Jump to

Keyboard shortcuts

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