Documentation
¶
Index ¶
- type PeriodicJob
- type PeriodicJobGetAllParams
- type PeriodicJobKeepAliveAndReapParams
- type PeriodicJobUpsertManyParams
- type PeriodicJobUpsertParams
- type Pilot
- type PilotPeriodicJob
- type ProducerInitParams
- type ProducerShutdownParams
- type ProducerState
- type QueueMetadataChangedParams
- type StandardPilot
- func (p *StandardPilot) JobGetAvailable(ctx context.Context, exec riverdriver.Executor, state ProducerState, ...) ([]*rivertype.JobRow, error)
- func (p *StandardPilot) JobInsertMany(ctx context.Context, execTx riverdriver.ExecutorTx, ...) ([]*riverdriver.JobInsertFastResult, error)
- func (p *StandardPilot) JobSetStateIfRunningMany(ctx context.Context, execTx riverdriver.ExecutorTx, ...) ([]*rivertype.JobRow, error)
- func (p *StandardPilot) PeriodicJobGetAll(ctx context.Context, exec riverdriver.Executor, ...) ([]*PeriodicJob, error)
- func (p *StandardPilot) PeriodicJobKeepAliveAndReap(ctx context.Context, exec riverdriver.Executor, ...) ([]*PeriodicJob, error)
- func (p *StandardPilot) PeriodicJobUpsertMany(ctx context.Context, exec riverdriver.Executor, ...) ([]*PeriodicJob, error)
- func (p *StandardPilot) PilotInit(archetype *baseservice.Archetype)
- func (p *StandardPilot) ProducerInit(ctx context.Context, exec riverdriver.Executor, params *ProducerInitParams) (int64, ProducerState, error)
- func (p *StandardPilot) ProducerKeepAlive(ctx context.Context, exec riverdriver.Executor, ...) error
- func (p *StandardPilot) ProducerShutdown(ctx context.Context, exec riverdriver.Executor, params *ProducerShutdownParams) error
- func (p *StandardPilot) QueueMetadataChanged(ctx context.Context, exec riverdriver.Executor, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeriodicJob ¶ added in v0.23.0
type PeriodicJobGetAllParams ¶ added in v0.23.0
type PeriodicJobGetAllParams struct {
Schema string
}
type PeriodicJobKeepAliveAndReapParams ¶ added in v0.23.0
type PeriodicJobUpsertManyParams ¶ added in v0.23.0
type PeriodicJobUpsertManyParams struct {
Jobs []*PeriodicJobUpsertParams
Schema string
}
type PeriodicJobUpsertParams ¶ added in v0.23.0
type Pilot ¶
type Pilot interface {
PilotPeriodicJob
JobGetAvailable(
ctx context.Context,
exec riverdriver.Executor,
state ProducerState,
params *riverdriver.JobGetAvailableParams,
) ([]*rivertype.JobRow, error)
JobInsertMany(
ctx context.Context,
execTx riverdriver.ExecutorTx,
params *riverdriver.JobInsertFastManyParams,
) ([]*riverdriver.JobInsertFastResult, error)
JobSetStateIfRunningMany(ctx context.Context, execTx 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 PilotPeriodicJob ¶ added in v0.23.0
type PilotPeriodicJob interface {
// PeriodicJobGetAll gets all currently known periodic jobs.
//
// API is not stable. DO NOT USE.
PeriodicJobGetAll(ctx context.Context, exec riverdriver.Executor, params *PeriodicJobGetAllParams) ([]*PeriodicJob, error)
// PeriodicJobTouchMany updates the `updated_at` timestamp on many jobs at
// once to keep them alive and reaps any jobs that haven't been seen in some
// time.
//
// API is not stable. DO NOT USE.
PeriodicJobKeepAliveAndReap(ctx context.Context, exec riverdriver.Executor, params *PeriodicJobKeepAliveAndReapParams) ([]*PeriodicJob, error)
// PeriodicJobUpsertMany upserts many periodic jobs.
//
// API is not stable. DO NOT USE.
PeriodicJobUpsertMany(ctx context.Context, exec riverdriver.Executor, params *PeriodicJobUpsertManyParams) ([]*PeriodicJob, error)
}
PilotPeriodicJob contains pilot functions related to periodic jobs. This is extracted as its own interface so there's less surface area to mock in places like the periodic job enqueuer where that's needed.
type ProducerInitParams ¶ added in v0.20.0
type ProducerShutdownParams ¶ added in v0.21.0
type ProducerState ¶ added in v0.20.0
type QueueMetadataChangedParams ¶ added in v0.21.0
type StandardPilot ¶
type StandardPilot struct {
// contains filtered or unexported fields
}
func (*StandardPilot) JobGetAvailable ¶ added in v0.20.0
func (p *StandardPilot) JobGetAvailable(ctx context.Context, exec riverdriver.Executor, state ProducerState, params *riverdriver.JobGetAvailableParams) ([]*rivertype.JobRow, error)
func (*StandardPilot) JobInsertMany ¶
func (p *StandardPilot) JobInsertMany( ctx context.Context, execTx riverdriver.ExecutorTx, params *riverdriver.JobInsertFastManyParams, ) ([]*riverdriver.JobInsertFastResult, error)
func (*StandardPilot) JobSetStateIfRunningMany ¶
func (p *StandardPilot) JobSetStateIfRunningMany(ctx context.Context, execTx riverdriver.ExecutorTx, params *riverdriver.JobSetStateIfRunningManyParams) ([]*rivertype.JobRow, error)
func (*StandardPilot) PeriodicJobGetAll ¶ added in v0.23.0
func (p *StandardPilot) PeriodicJobGetAll(ctx context.Context, exec riverdriver.Executor, params *PeriodicJobGetAllParams) ([]*PeriodicJob, error)
func (*StandardPilot) PeriodicJobKeepAliveAndReap ¶ added in v0.23.0
func (p *StandardPilot) PeriodicJobKeepAliveAndReap(ctx context.Context, exec riverdriver.Executor, params *PeriodicJobKeepAliveAndReapParams) ([]*PeriodicJob, error)
func (*StandardPilot) PeriodicJobUpsertMany ¶ added in v0.23.0
func (p *StandardPilot) PeriodicJobUpsertMany(ctx context.Context, exec riverdriver.Executor, params *PeriodicJobUpsertManyParams) ([]*PeriodicJob, error)
func (*StandardPilot) PilotInit ¶
func (p *StandardPilot) PilotInit(archetype *baseservice.Archetype)
func (*StandardPilot) ProducerInit ¶ added in v0.20.0
func (p *StandardPilot) ProducerInit(ctx context.Context, exec riverdriver.Executor, params *ProducerInitParams) (int64, ProducerState, error)
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
Click to show internal directories.
Click to hide internal directories.