pubsub_subscriber

package
v0.0.0-...-7edcfce Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscriber

type Subscriber interface {
	Subscribe(topic Topic) (string, error)
	Unsubscribe(topicName string, subscriptionId ...string)
	Shutdown(ctx context.Context) error

	Handle(ctx op_context.Context, topicName string, msg []byte) error
}

type SubscriberBase

type SubscriberBase struct {
	app_context.WithAppBase
	// contains filtered or unexported fields
}

func (*SubscriberBase) AddTopic

func (s *SubscriberBase) AddTopic(topic Topic) (string, error)

func (*SubscriberBase) Construct

func (s *SubscriberBase) Construct(app app_context.Context, serializer ...message.Serializer)

func (*SubscriberBase) DeleteTopic

func (s *SubscriberBase) DeleteTopic(topicName string, subscriptionId ...string) bool

func (*SubscriberBase) Handle

func (s *SubscriberBase) Handle(ctx op_context.Context, topicName string, msg []byte) error

func (*SubscriberBase) NewOpContext

func (s *SubscriberBase) NewOpContext(topicName string) op_context.Context

func (*SubscriberBase) Topics

func (s *SubscriberBase) Topics(topicName string) (map[string]Topic, error)

type SubscriberClient

type SubscriberClient[T any] interface {
	Name() string
	Handle(ctx op_context.Context, msg T) error
}

type SubscriberClientBase

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

func (*SubscriberClientBase) Init

func (s *SubscriberClientBase) Init(name string)

func (*SubscriberClientBase) Name

func (s *SubscriberClientBase) Name() string

type Topic

type Topic interface {
	Name() string
	Handle(ctx op_context.Context, msg []byte, serializer message.Serializer) error
	Unsubscribe(id string)
}

type TopicBase

type TopicBase[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](name string, builder func() T) *TopicBase[T]

func (*TopicBase[T]) Handle

func (t *TopicBase[T]) Handle(ctx op_context.Context, msg []byte, serializer message.Serializer) error

func (*TopicBase[T]) Name

func (t *TopicBase[T]) Name() string

func (*TopicBase[T]) Subscribe

func (t *TopicBase[T]) Subscribe(subscriber SubscriberClient[T])

func (*TopicBase[T]) Unsubscribe

func (t *TopicBase[T]) Unsubscribe(id string)

type TopicT

type TopicT[T any] interface {
	Topic
	Subscribe(subscriber SubscriberClient[T])
}

type WithSubscriber

type WithSubscriber interface {
	Subscriber() Subscriber
}

Jump to

Keyboard shortcuts

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