subscribers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeartbeatSubscriber

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

Struct for a subscriber that will listen to heartbeats

func NewHeartbeatSubscriber

func NewHeartbeatSubscriber(bus glocbus.EventBusInterface, sourceId string, name string, tracerProvider trace.TracerProvider, logger *log.Logger) *HeartbeatSubscriber

Description

Build and return a non-started heartbeat subscriber.

Inputs

  • bus: Bus which is used to publish events to this subscriber will subscribe to.
  • sourceId: ID of the source to subscribe to.
  • name: Name of the subscriber
  • tracerProvider: Provider to use to get a tracer. If nil, global tracer provider is used.
  • logger: Logger to use to publish debug logs. If nil, debug logs will be discarded.

Return

A new, non-started heartbeat subscriber.

func (*HeartbeatSubscriber) Start

func (subscriber *HeartbeatSubscriber) Start(ctx context.Context) error

Description

Start the subscriber: The susbcriber will subscribe to the source of events through the event bus and will start an internal goroutine to process events

func (*HeartbeatSubscriber) Stop

func (subscriber *HeartbeatSubscriber) Stop(ctx context.Context) error

Description

Stop the subscriber that will unsubscribe from the event source

Jump to

Keyboard shortcuts

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