mqtt

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

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobDefinition

type JobDefinition struct {
	Topic          string
	Job            worker.Job
	ConcurrentJobs uint32
}

func NewDefinition

func NewDefinition(topic string, job worker.Job, concurrentJobs uint32) *JobDefinition

type Worker

type Worker struct {
	*worker.WorkerBase
	// contains filtered or unexported fields
}

An MQTT worker that will subscribe to a topic and execute a job for each message received

func NewWorker

func NewWorker(client mqtt.Client, jobDef *JobDefinition, opts ...WorkerOpt) *Worker

func (*Worker) Stop

func (a *Worker) Stop(ctx context.Context) error

type WorkerOpt

type WorkerOpt func(*Worker)

func WithGetWorkFunc

func WithGetWorkFunc(getWork worker.GetWorkFunc) WorkerOpt

func WithName

func WithName(name string) WorkerOpt

Jump to

Keyboard shortcuts

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