messagebus

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: ISC Imports: 6 Imported by: 0

Documentation

Overview

Package messagebus - a queuing system for all message packets whether internally generated or received from peers

Index

Constants

View Source
const Default = -1

for select the default queue size

Variables

View Source
var Bus busses

Bus - all available message queues

Functions

This section is empty.

Types

type BroadcastQueue added in v0.6.0

type BroadcastQueue struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

BroadcastQueue - a 1:M queue out is synchronous, so messages to routines not waiting are dropped

func (*BroadcastQueue) Chan added in v0.6.0

func (queue *BroadcastQueue) Chan(size int) <-chan Message

Chan - get a new channel to read from a 1:M queue each call gets a distinct channel

func (*BroadcastQueue) Release added in v0.11.0

func (queue *BroadcastQueue) Release()

Release - release the incoming and outgoing queue

func (*BroadcastQueue) Send added in v0.6.0

func (queue *BroadcastQueue) Send(command string, parameters ...[]byte)

Send - send a message to a 1:M queue

type Message

type Message struct {
	Command    string   // type of packed data
	Parameters [][]byte // array of parameters
}

Message - message to put into a queue

type Queue added in v0.2.0

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

Queue - a 1:1 queue

func (*Queue) Chan added in v0.2.0

func (queue *Queue) Chan() <-chan Message

Chan - channel to read from 1:1 queue can only be called once

func (*Queue) Release added in v0.6.1

func (queue *Queue) Release()

Release - give the channel back

func (*Queue) Send added in v0.2.0

func (queue *Queue) Send(command string, parameters ...[]byte)

Send - send a message to a 1:1 queue but only if listener is connected

Jump to

Keyboard shortcuts

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