Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Id uint64
TaskId string
// Type and Data are opaque to the base system. The implementing app owns
// the namespace and serialization.
Type uint32
Data []byte
// ReferenceId is an optional correlation ID (eg. an intent ID) used purely
// for observability. The base system never reads it.
ReferenceId *string
State State
FailedAttempts uint32
NextAttemptAt time.Time
Version uint64
CreatedAt time.Time
}
type Store ¶
type Store interface {
// PutAll creates all tasks in a single operation. This method supports
// being executed within an existing DB transaction passed along ctx.
PutAll(ctx context.Context, records ...*Record) error
// Update updates an existing task with an optimistic concurrency check
// on the version. Only mutable fields (state, failed attempts, next
// attempt timestamp) are updated.
Update(ctx context.Context, record *Record) error
// GetByTaskId gets a task by its task ID
GetByTaskId(ctx context.Context, taskId string) (*Record, error)
// GetAllReadyByState gets all tasks in the provided state whose next
// attempt timestamp is at or before asOf
GetAllReadyByState(ctx context.Context, state State, asOf time.Time, cursor query.Cursor, limit uint64, direction query.Ordering) ([]*Record, error)
// CountByState returns the count of tasks in the requested state
CountByState(ctx context.Context, state State) (uint64, error)
}
Click to show internal directories.
Click to hide internal directories.