broker

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 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 AMQPBroker

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

AMQPBroker represents the primary natsshim communication instance

func (*AMQPBroker) Evacuate

func (broker *AMQPBroker) Evacuate()

func (*AMQPBroker) Healthy

func (broker *AMQPBroker) Healthy() bool

Healthy checks the health of the broker

func (*AMQPBroker) Initialize

func (broker *AMQPBroker) Initialize(config config.Config, jobManifest *job.Manifest) bool

Initialize creates a new natsshim connection

func (*AMQPBroker) IsRunning

func (broker *AMQPBroker) IsRunning() bool

func (*AMQPBroker) PublishMessage

func (broker *AMQPBroker) PublishMessage(event event.Event) error

PublishResult result will publish the worker result to the message queue

func (*AMQPBroker) Start

func (broker *AMQPBroker) Start() error

Start creates a new subscription and executes the messageCallback on new messages

func (*AMQPBroker) Stop

func (broker *AMQPBroker) Stop() error

func (*AMQPBroker) Teardown

func (broker *AMQPBroker) Teardown()

Teardown the natsshim connection and all natsshim services

type AmqpMessageWrapper

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

func (AmqpMessageWrapper) GetData

func (wrapper AmqpMessageWrapper) GetData() []byte

type Shim

type Shim interface {

	// Initial setup for all broker connections and runtime state
	Initialize(config.Config, *job.Manifest) bool

	// Initial setup for all broker connections and runtime state
	Evacuate()

	// Gracefully disconnect broker from any external resources
	Teardown()

	// Start the broker to enable message recieving
	Start() error

	// Rreturn true if the broker is currently active (if Start was called)
	IsRunning() bool

	// Stop message recieving, while still keeping open fundamental connections to external resources
	Stop() error

	// Healthcheck to verify that the broker is not stuck. This will restart the container if it fails and healthchecks are set up correctly
	Healthy() bool

	// Publish new message to broker. This is used for chaining events.
	PublishMessage(event.Event) error
}

Jump to

Keyboard shortcuts

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