worker

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package worker processes chunk jobs and publishes output events.

Index

Constants

This section is empty.

Variables

View Source
var ErrLambdaExecutionLimitExceeded = errors.New("excedeu o limite de execução da lambda")

ErrLambdaExecutionLimitExceeded identifies work deliberately stopped before the Lambda runtime can terminate the invocation. Callers use this to record an incomplete chunk with a reason that is actionable in the ledger.

Functions

This section is empty.

Types

type ChunkProcessingResult

type ChunkProcessingResult struct {
	JobID                string
	FileID               string
	ChunkID              string
	Bucket               string
	Key                  string
	StartByte            int64
	EndByte              int64
	Attempt              int
	BytesProcessed       int64
	RecordsProcessed     int64
	ProcessingTimeMillis int64
	TPS                  float64
}

ChunkProcessingResult contains metrics from processing a chunk

type Service

type Service struct {
	Resolver         port.SourceResolver
	Queue            port.Queue
	Ledger           port.JobLedger
	CompletionLedger port.CompletionLedger
	Config           config.Config
}

func (Service) Process

func (s Service) Process(ctx context.Context, body []byte) error

func (Service) ProcessAttempt

func (s Service) ProcessAttempt(ctx context.Context, body []byte, attempt int) error

ProcessAttempt records the delivery attempt reported by SQS in the ledger.

func (Service) ProcessWithMetrics

func (s Service) ProcessWithMetrics(ctx context.Context, body []byte) (*ChunkProcessingResult, error)

ProcessWithMetrics processes a chunk and returns metrics

Jump to

Keyboard shortcuts

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