riverpilot

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 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.JobInsertFastParams,
	) ([]*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, producerID int64, state ProducerState) error

	QueueMetadataChanged(ctx context.Context, exec riverdriver.Executor, state ProducerState, metadata []byte) 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
}

type ProducerState added in v0.20.0

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

type StandardPilot

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

func (*StandardPilot) JobGetAvailable added in v0.20.0

func (*StandardPilot) JobInsertMany

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, producerID int64, state ProducerState) error

func (*StandardPilot) QueueMetadataChanged added in v0.20.0

func (p *StandardPilot) QueueMetadataChanged(ctx context.Context, exec riverdriver.Executor, state ProducerState, metadata []byte) error

Jump to

Keyboard shortcuts

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