loop

package
v0.0.0-...-144358a Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: MIT Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPollItems   = errors.New("empty PollItems")
	ErrTooManyPollItems = errors.New("no more than 255 PollItems supported")
)

Functions

This section is empty.

Types

type Cmd

type Cmd interface {
	Type() int
}

type CommandHandler

type CommandHandler func(cmd Cmd)

type CommandHandlers

type CommandHandlers []CommandHandler

type MessageHandler

type MessageHandler func(msg [][]byte)

type MessageLoop

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

MessageLoop is NOT THREAD-SAFE. It is supposed to be used from within another object that handles the synchronization.

func New

func New(items PollItems, handlers CommandHandlers) (*MessageLoop, error)

func (*MessageLoop) PushCommand

func (ml *MessageLoop) PushCommand(cmd Cmd) error

func (*MessageLoop) Terminate

func (ml *MessageLoop) Terminate() 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