subscriber

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Project                      string `json:"project"`
	Subscription                 string `json:"subscription"`
	Topic                        string `json:"topic"`
	PullerNumGoroutines          int    `json:"pullerNumGoroutines"`
	PullerMaxOutstandingMessages int    `json:"pullerMaxOutstandingMessages"`
	PullerMaxOutstandingBytes    int    `json:"pullerMaxOutstandingBytes"`
	MaxMPS                       int    `json:"maxMPS"`
	WorkerNum                    int    `json:"workerNum"`
}

type MultiSubscriber

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

func NewMultiSubscriber

func NewMultiSubscriber(opts ...Option) *MultiSubscriber

func (*MultiSubscriber) AddSubscriber

func (m *MultiSubscriber) AddSubscriber(subscriber *Subscriber)

func (*MultiSubscriber) Start

func (m *MultiSubscriber) Start(ctx context.Context)

func (*MultiSubscriber) Stop

func (m *MultiSubscriber) Stop()

type Option

type Option func(*options)

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMetrics

func WithMetrics(r metrics.Registerer) Option

type Processor

type Processor interface {
	Process(ctx context.Context, msgChan <-chan *puller.Message) error
}

type Subscriber

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

func NewSubscriber

func NewSubscriber(
	name string,
	configuration Configuration,
	processor Processor,
	opts ...Option,
) *Subscriber

func (Subscriber) Run

func (s Subscriber) Run(ctx context.Context)

func (Subscriber) Stop

func (s Subscriber) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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