pub_sub

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChannelPubSubDefaultConfig = gochannel.Config{
	OutputChannelBuffer:            10,
	Persistent:                     true,
	BlockPublishUntilSubscriberAck: false,
}

Functions

This section is empty.

Types

type ChannelPubSub

type ChannelPubSub struct {
	Client *gochannel.GoChannel
}

func NewPubSubHandlerChannel

func NewPubSubHandlerChannel(config gochannel.Config) ChannelPubSub

NewPubSubHandlerChannel this handler uses Watermill's go channels implementation as message engine

func (ChannelPubSub) Publish

func (p ChannelPubSub) Publish(topic string, msg *message.Message) error

func (ChannelPubSub) Subscribe

func (p ChannelPubSub) Subscribe(topic string, cb func(messages <-chan *message.Message)) error

type DBSubscriptionClient

type DBSubscriptionClient struct {
	Client IDBSubscriptionClient
}

type IDBSubscriptionClient

type IDBSubscriptionClient interface {
	Subscribe(query interface{}, handler func(message *json.RawMessage, err error) error) error
	Unsubscribe() error
	Start() error
	Stop() error
}

type ITopicPubSubClient

type ITopicPubSubClient interface {
	Subscribe(string, func(messages <-chan *message.Message)) error
	Publish(string, *message.Message) error
}

type TopicPubSubClient

type TopicPubSubClient struct {
	Client ITopicPubSubClient
}

Jump to

Keyboard shortcuts

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