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 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 }
Click to show internal directories.
Click to hide internal directories.