redisnatsbroker

package
v5.4.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	*natsbroker.NatsBroker
	// contains filtered or unexported fields
}

Broker is a combination of centrifuge.RedisBroker and NatsBroker. Redis is used for history operations and/or idempotent result cache. Nats is used for PUB/SUB part. The important limitation is that publications to this Broker must be sequential for the same channel. Otherwise, we can't guarantee message ordering and stable behavior of clients with auto recovery on. The benefit is more efficient fan-in in Nats PUB/SUB. Also, this allows scaling Redis Cluster without PUB/SUB scalability restrictions. This is EXPERIMENTAL.

func New

func New(nats *natsbroker.NatsBroker, redis *centrifuge.RedisBroker) (*Broker, error)

func (*Broker) History

History ...

func (*Broker) Publish

func (b *Broker) Publish(ch string, data []byte, opts centrifuge.PublishOptions) (centrifuge.StreamPosition, bool, error)

func (*Broker) RemoveHistory

func (b *Broker) RemoveHistory(ch string) error

RemoveHistory ...

Jump to

Keyboard shortcuts

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