Documentation ¶
Overview ¶
Package messageq provides a reliable pub/sub bus for long term listeners job queuing
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArbitraryMessage ¶
type ArbitraryMessage map[string]interface{}
An arbitrary message object that can be directly used by applications
func (ArbitraryMessage) Id ¶
func (t ArbitraryMessage) Id() []byte
type Config ¶
type Config struct { *RelyQConfig // Subscribers cache decay duration SubscriberListDecay time.Duration }
type Discovery ¶
type Discovery interface { // Register an endpoint as listening on a channel Register(channel, endpoint string) error // Unregister an endpoint as listening on a channel Unregister(channel, endpiont string) error // List subscribers to a channel Subscribers(channel string) ([]string, error) io.Closer }
Interface for discovery backend's to implement
type MessageQueue ¶
type MessageQueue struct { Errors chan error // contains filtered or unexported fields }
A message queue object.
func (*MessageQueue) Close ¶
func (mq *MessageQueue) Close() error
func (*MessageQueue) Publish ¶
func (mq *MessageQueue) Publish(channel string, message Message) error
Publish a message on a channel
func (*MessageQueue) Subscribe ¶
func (mq *MessageQueue) Subscribe(channel string, example Message) (chan Message, error)
Subscribe on a channel. Returns the channel of messages
func (*MessageQueue) Unsubscribe ¶
func (mq *MessageQueue) Unsubscribe(channel string) error
Unsubscribe from a channel
type RelyQConfig ¶
func (*RelyQConfig) Defaults ¶
func (rqc *RelyQConfig) Defaults()
type StructuredMessage ¶
type StructuredMessage struct {
MqId string `json:"id"`
}
A struct that implements Ider to be used in message objects for applications. Use like so:
type MyMessage struct { StructuredMessage OtherFields string }
func (*StructuredMessage) Id ¶
func (t *StructuredMessage) Id() []byte
Click to show internal directories.
Click to hide internal directories.