queue

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Topic

type Topic struct {
	ProjectID string
	// contains filtered or unexported fields
}

Topic encapsulates the message queue topic

func New

func New(ctx context.Context, projectID string, topicName string) (*Topic, report.Span)

New creates a message queue topic

func (*Topic) Publish

func (t *Topic) Publish(ctx context.Context, s *gauge.Snapshot) report.Span

Publish writes an AVRO encoded Snapshot to the topic

func (*Topic) Stop

func (t *Topic) Stop()

Stop cleanly closes the topic

func (*Topic) Subscribe

func (t *Topic) Subscribe(ctx context.Context, consumerGroup string,
	fn func(ctx context.Context, err error, s *gauge.Snapshot) error) error

Subscribe reads AVRO encoded snapshots from the topic and decodes them

Note a zero length consumerGroup means auto-generate the pubsub subscription string and delete once done.

Jump to

Keyboard shortcuts

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