goch

package
v0.0.0-...-777230d Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

GO SIMPLE PUB SUB MESSAGE QUEUE IMPLEMENTATION

We create channels for channels to be able to publish/subscribe and we do this in purpose to be able to conform with the publish subscribe message queue (PSMQ) interface

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PSMQ

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

func New

func New() *PSMQ

func (*PSMQ) Close

func (c *PSMQ) Close()

func (*PSMQ) CreatePublishTopic

func (c *PSMQ) CreatePublishTopic(name string) chan<- []byte

func (*PSMQ) Done

func (c *PSMQ) Done() chan struct{}

func (*PSMQ) ErrChan

func (c *PSMQ) ErrChan() chan error

func (*PSMQ) Init

func (c *PSMQ) Init()

func (*PSMQ) SubscribeToTopic

func (c *PSMQ) SubscribeToTopic(name string) <-chan []byte

type PubSubAgent

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

Agent is a simple pub/sub agent

var SingleGoPubSubAgent *PubSubAgent

func NewPubSubAgent

func NewPubSubAgent() *PubSubAgent

NewAgent creates a new Agent as a singleton, we do not create new agents over and over again

func (*PubSubAgent) Close

func (b *PubSubAgent) Close()

Close closes the agent

func (*PubSubAgent) Publish

func (b *PubSubAgent) Publish(topic string, msg []byte)

Publish publishes a message to a topic

func (*PubSubAgent) Subscribe

func (b *PubSubAgent) Subscribe(topic string) <-chan []byte

Subscribe subscribes to a topic

Jump to

Keyboard shortcuts

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