riverpilot

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: MPL-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 Pilot

type Pilot interface {
	JobGetAvailable(
		ctx context.Context,
		exec riverdriver.Executor,
		state ProducerState,
		params *riverdriver.JobGetAvailableParams,
	) ([]*rivertype.JobRow, error)

	JobInsertMany(
		ctx context.Context,
		tx riverdriver.ExecutorTx,
		params *riverdriver.JobInsertFastManyParams,
	) ([]*riverdriver.JobInsertFastResult, error)

	JobSetStateIfRunningMany(ctx context.Context, tx riverdriver.ExecutorTx, params *riverdriver.JobSetStateIfRunningManyParams) ([]*rivertype.JobRow, error)

	PilotInit(archetype *baseservice.Archetype)

	// ProducerInit is called when a producer is started. It should return the ID
	// of the new producer, a new state object that will be used to track the
	// producer's state, and an error if the producer could not be initialized.
	ProducerInit(ctx context.Context, exec riverdriver.Executor, params *ProducerInitParams) (int64, ProducerState, error)

	ProducerKeepAlive(ctx context.Context, exec riverdriver.Executor, params *riverdriver.ProducerKeepAliveParams) error

	ProducerShutdown(ctx context.Context, exec riverdriver.Executor, params *ProducerShutdownParams) error

	QueueMetadataChanged(ctx context.Context, exec riverdriver.Executor, params *QueueMetadataChangedParams) error
}

A Pilot bridges the gap between the River client and the driver, implementing higher level functionality on top of the driver's underlying queries. It tracks closely to the underlying driver's API, but may add additional functionality or logic wrapping the queries.

This should be considered a River internal API and its stability is not guaranteed. DO NOT USE.

type ProducerInitParams added in v0.20.0

type ProducerInitParams struct {
	ClientID      string
	ProducerID    int64
	Queue         string
	QueueMetadata []byte
	Schema        string
}

type ProducerShutdownParams added in v0.21.0

type ProducerShutdownParams struct {
	ProducerID int64
	Schema     string
	State      ProducerState
}

type ProducerState added in v0.20.0

type ProducerState interface {
	JobFinish(job *rivertype.JobRow)
}

type QueueMetadataChangedParams added in v0.21.0

type QueueMetadataChangedParams struct {
	Metadata []byte
	Schema   string
	State    ProducerState
}

type StandardPilot

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

func (*StandardPilot) JobGetAvailable added in v0.20.0

func (*StandardPilot) JobSetStateIfRunningMany

func (*StandardPilot) PilotInit

func (p *StandardPilot) PilotInit(archetype *baseservice.Archetype)

func (*StandardPilot) ProducerInit added in v0.20.0

func (*StandardPilot) ProducerKeepAlive added in v0.20.0

func (p *StandardPilot) ProducerKeepAlive(ctx context.Context, exec riverdriver.Executor, params *riverdriver.ProducerKeepAliveParams) error

func (*StandardPilot) ProducerShutdown added in v0.20.0

func (p *StandardPilot) ProducerShutdown(ctx context.Context, exec riverdriver.Executor, params *ProducerShutdownParams) error

func (*StandardPilot) QueueMetadataChanged added in v0.20.0

func (p *StandardPilot) QueueMetadataChanged(ctx context.Context, exec riverdriver.Executor, params *QueueMetadataChangedParams) error

Jump to

Keyboard shortcuts

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