signal

package
v0.0.0-...-176f8cf Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 2 Imported by: 0

README

This package is not being used right now. However, it could be planned to server as and abstraction layer between current used solution and AreYouIN.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrListenerClosed = errors.New("listener closed")
)

Functions

This section is empty.

Types

type Broadcast

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

func NewBroadcast

func NewBroadcast() *Broadcast

func (*Broadcast) Close

func (bc *Broadcast) Close()

func (*Broadcast) Join

func (bc *Broadcast) Join() *Listener

func (*Broadcast) Send

func (bc *Broadcast) Send(signal *Signal)

type Listener

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

A listener must be used only from a goroutine.

func (*Listener) Leave

func (l *Listener) Leave()

Can be called from another thread

func (*Listener) Recv

func (l *Listener) Recv() (*Signal, error)

Must be called from the same goroutine over all the lifecycle of the listener

type Signal

type Signal struct {
	Key  string
	Data interface{}
}

Jump to

Keyboard shortcuts

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