loop

package
v0.0.0-...-ff27e19 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPollItems   = errors.New("Empty PollItems")
	ErrEmptyMessage     = errors.New("Empty message")
	ErrTooManyPollItems = errors.New("No mobre than 255 PollItems are supported")
)

Functions

This section is empty.

Types

type ErrInvalidState

type ErrInvalidState struct {
	Expected LoopState
	Current  LoopState
}

func (*ErrInvalidState) Error

func (err *ErrInvalidState) Error() string

type LoopState

type LoopState byte

func (LoopState) String

func (state LoopState) String() string

type MessageHandler

type MessageHandler func(msg [][]byte)

type MessageLoop

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

func New

func New(items PollItems) *MessageLoop

func (*MessageLoop) Close

func (loop *MessageLoop) Close() error

func (*MessageLoop) DispatchMessage

func (loop *MessageLoop) DispatchMessage(itemIndex byte, msg [][]byte) error

func (*MessageLoop) ListenAndServe

func (loop *MessageLoop) ListenAndServe() error

type PollItem

type PollItem struct {
	Socket   *zmq.Socket
	Callback MessageHandler
}

type PollItems

type PollItems []PollItem

Jump to

Keyboard shortcuts

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