schedule

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Key   string          `json:"key"`
	Event string          `json:"event"`
	After string          `json:"after"`
	Data  json.RawMessage `json:"data"`
}

func ParseChain

func ParseChain(raw json.RawMessage) (Chain, error)

type Module

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

func New

func New(db *pgxpool.Pool, calendars *calendar.Module, newID func() string, startWorkflow func(context.Context, string, protocol.Frame) protocol.Reply) *Module

func (*Module) AdvanceRecurrence

func (m *Module) AdvanceRecurrence(ctx context.Context, tx pgx.Tx, scheduleID string) error

AdvanceRecurrence arms the next clock occurrence on the same Schedule after its Delivery is acknowledged. A Schedule without a recurrence stays delivered. When several later slots are already due, it arms the latest one once.

func (*Module) Cancel

func (m *Module) Cancel(ctx context.Context, app string, f protocol.Frame) protocol.Reply

func (*Module) CollapseMissed

func (m *Module) CollapseMissed(ctx context.Context, tx pgx.Tx) error

CollapseMissed keeps one pending Delivery for a recurring Schedule and moves that Schedule to the latest occurrence already due. Earlier missed slots are not delivered.

func (*Module) Enqueue added in v0.2.0

func (m *Module) Enqueue(ctx context.Context, app string, f protocol.Frame) protocol.Reply

Enqueue creates an immediate, independently named schedule using ordinary delivery rules.

func (*Module) Extend

func (m *Module) Extend(ctx context.Context, app string, f protocol.Frame) protocol.Reply

func (*Module) FinishOccurrence

func (m *Module) FinishOccurrence(ctx context.Context, tx pgx.Tx, app, event, key string) error

FinishOccurrence accepts the completion Signal for the open occurrence. The correlation key is the Schedule key. Acknowledgement does not call this.

func (*Module) Set

func (m *Module) Set(ctx context.Context, app string, f protocol.Frame) protocol.Reply

func (*Module) SetAfterTx

func (m *Module) SetAfterTx(ctx context.Context, tx pgx.Tx, app string, f protocol.Frame) protocol.Reply

SetAfterTx creates or replaces a schedule due f.After from the transaction's now().

func (*Module) SetStart

func (m *Module) SetStart(ctx context.Context, f protocol.Frame) protocol.Reply

func (*Module) SkipUnfinished

func (m *Module) SkipUnfinished(ctx context.Context, tx pgx.Tx, scheduleID string) (bool, error)

SkipUnfinished records a due slot that must not start a Delivery while the previous occurrence is still awaiting its completion Signal, then arms the following slot.

func (*Module) StartRecurring

func (m *Module) StartRecurring(ctx context.Context)

func (*Module) Throttle

func (m *Module) Throttle(ctx context.Context, app string, f protocol.Frame) protocol.Reply

Jump to

Keyboard shortcuts

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