pair

package
v0.0.1-alpha-8 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Handle(interface{})
}

type Message

type Message struct {
	Payload interface{}
}

type Pair

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

Pair represents a pair of a watcher and a handler, to which the watcher pushes messages which the handler processes

func NewPair

func NewPair(watcher Watcher, handler Handler) *Pair

func (*Pair) Listen

func (p *Pair) Listen()

Listen begins the actions of the handler and the watcher

type Queue

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

Queue is a wrapper of a go channel, particularly to restrict actions on the channel itself

func NewQueue

func NewQueue() *Queue

func (*Queue) Push

func (q *Queue) Push(message *Message)

Push pushes a message to the channel

type Watcher

type Watcher interface {
	Watch(queue *Queue)
}

Jump to

Keyboard shortcuts

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