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 ¶
func (b *Broker) History(ch string, opts centrifuge.HistoryOptions) ([]*centrifuge.Publication, centrifuge.StreamPosition, error)
History ...
func (*Broker) Publish ¶
func (b *Broker) Publish(ch string, data []byte, opts centrifuge.PublishOptions) (centrifuge.StreamPosition, bool, error)
Click to show internal directories.
Click to hide internal directories.