pubsub

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler added in v1.1.4

type Handler interface {
	Broadcast(msg *common.StreamMessage)
	ExecuteRemoteCommand(msg *common.RemoteCommandMessage)
}

type LegacySubscriber added in v1.4.0

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

func NewLegacySubscriber added in v1.4.0

func NewLegacySubscriber(node Handler) *LegacySubscriber

NewLegacySubscriber creates a legacy subscriber implementation to work with legacy Redis and NATS broadcasters

func (*LegacySubscriber) Broadcast added in v1.4.0

func (s *LegacySubscriber) Broadcast(msg *common.StreamMessage)

func (*LegacySubscriber) BroadcastCommand added in v1.4.0

func (s *LegacySubscriber) BroadcastCommand(cmd *common.RemoteCommandMessage)

func (*LegacySubscriber) IsMultiNode added in v1.4.0

func (s *LegacySubscriber) IsMultiNode() bool

func (LegacySubscriber) Shutdown added in v1.4.0

func (LegacySubscriber) Shutdown(ctx context.Context) error

func (LegacySubscriber) Start added in v1.4.0

func (LegacySubscriber) Start(done chan (error)) error

func (LegacySubscriber) Subscribe added in v1.4.0

func (LegacySubscriber) Subscribe(stream string)

func (LegacySubscriber) Unsubscribe added in v1.4.0

func (LegacySubscriber) Unsubscribe(stream string)

type NATSSubscriber added in v1.2.2

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

func NewNATSSubscriber added in v1.2.2

func NewNATSSubscriber(node Handler, config *nconfig.NATSConfig) (*NATSSubscriber, error)

NewNATSSubscriber creates a NATS subscriber using pub/sub

func (*NATSSubscriber) Broadcast added in v1.4.0

func (s *NATSSubscriber) Broadcast(msg *common.StreamMessage)

func (*NATSSubscriber) BroadcastCommand added in v1.4.0

func (s *NATSSubscriber) BroadcastCommand(cmd *common.RemoteCommandMessage)

func (*NATSSubscriber) IsMultiNode added in v1.4.0

func (s *NATSSubscriber) IsMultiNode() bool

func (*NATSSubscriber) Publish added in v1.4.0

func (s *NATSSubscriber) Publish(stream string, msg interface{})

func (*NATSSubscriber) Shutdown added in v1.2.2

func (s *NATSSubscriber) Shutdown(ctx context.Context) error

func (*NATSSubscriber) Start added in v1.2.2

func (s *NATSSubscriber) Start(done chan (error)) error

func (*NATSSubscriber) Subscribe added in v1.4.0

func (s *NATSSubscriber) Subscribe(stream string)

func (*NATSSubscriber) Unsubscribe added in v1.4.0

func (s *NATSSubscriber) Unsubscribe(stream string)

type RedisSubscriber

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

func NewRedisSubscriber

func NewRedisSubscriber(node Handler, config *rconfig.RedisConfig) (*RedisSubscriber, error)

NewRedisSubscriber creates a Redis subscriber using pub/sub

func (*RedisSubscriber) Broadcast added in v1.4.0

func (s *RedisSubscriber) Broadcast(msg *common.StreamMessage)

func (*RedisSubscriber) BroadcastCommand added in v1.4.0

func (s *RedisSubscriber) BroadcastCommand(cmd *common.RemoteCommandMessage)

func (*RedisSubscriber) IsMultiNode added in v1.4.0

func (s *RedisSubscriber) IsMultiNode() bool

func (*RedisSubscriber) Publish added in v1.4.0

func (s *RedisSubscriber) Publish(stream string, msg interface{})

func (*RedisSubscriber) Shutdown added in v1.0.1

func (s *RedisSubscriber) Shutdown(ctx context.Context) error

func (*RedisSubscriber) Start

func (s *RedisSubscriber) Start(done chan (error)) error

func (*RedisSubscriber) Subscribe added in v1.4.0

func (s *RedisSubscriber) Subscribe(stream string)

func (*RedisSubscriber) Unsubscribe added in v1.4.0

func (s *RedisSubscriber) Unsubscribe(stream string)

type Subscriber added in v1.0.1

type Subscriber interface {
	Start(done chan (error)) error
	Shutdown(ctx context.Context) error
	Broadcast(msg *common.StreamMessage)
	BroadcastCommand(msg *common.RemoteCommandMessage)
	Subscribe(stream string)
	Unsubscribe(stream string)
	IsMultiNode() bool
}

Subscriber is responsible for subscribing to individual streams and and publishing messages to streams

Jump to

Keyboard shortcuts

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