rivermiddleware

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMiddleware

func DefaultMiddleware() []rivertype.Middleware

DefaultMiddleware returns the default middleware that River applies to all jobs. This includes internal middleware like the resumable step middleware.

Types

type ResumableContextKey

type ResumableContextKey struct{}

ResumableContextKey is the context key for ResumableState.

type ResumableMiddleware

type ResumableMiddleware struct{}

ResumableMiddleware is internal middleware that enables resumable step functionality. It reads the last completed step and cursor data from job metadata, injects them into the context, and persists updated step/cursor state back to metadata when a job errors after making progress.

func (*ResumableMiddleware) IsMiddleware

func (*ResumableMiddleware) IsMiddleware() bool

func (*ResumableMiddleware) Work

func (*ResumableMiddleware) Work(ctx context.Context, job *rivertype.JobRow, doInner func(ctx context.Context) error) error

type ResumableState

type ResumableState struct {
	CompletedStep string
	Cursors       map[string]json.RawMessage
	Err           error
	ResumeMatched bool
	ResumeStep    string
	StepName      string
}

ResumableState holds the state for a resumable job execution. It is stored in the context and accessed by ResumableStep and ResumableStepCursor.

Jump to

Keyboard shortcuts

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