worker

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package worker provides message processing workers for pg_flo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Worker)

Option is a function type that modifies Worker configuration

func WithBatchSize

func WithBatchSize(size int) Option

WithBatchSize sets the batch size for the worker

type Worker

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

Worker represents a worker that processes messages from NATS.

func NewWorker

func NewWorker(natsClient *pgflonats.NATSClient, ruleEngine *rules.RuleEngine, router *routing.Router, sink sinks.Sink, group string, opts ...Option) *Worker

NewWorker creates and returns a new Worker instance with the provided NATS client

func (*Worker) Start

func (w *Worker) Start(ctx context.Context) error

Start begins the worker's message processing loop, setting up the NATS consumer and processing messages.

Jump to

Keyboard shortcuts

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