Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrBadToken ¶
type ErrBadToken struct{ Err error }
ErrBadToken is an error indicating that there is an issue with the token itself
func (ErrBadToken) Error ¶
func (e ErrBadToken) Error() string
func (ErrBadToken) Unwrap ¶
func (e ErrBadToken) Unwrap() error
type ErrContractFlaking ¶
type ErrContractFlaking struct { Chain persist.Chain Contract persist.Address Err error Duration time.Duration }
ErrContractFlaking indicates that runs of this contract are frequently failing
func (ErrContractFlaking) Error ¶
func (e ErrContractFlaking) Error() string
func (ErrContractFlaking) Unwrap ¶
func (e ErrContractFlaking) Unwrap() error
type ErrContractPaused ¶
ErrContractPaused indicates that runs for this contract have been paused
func (ErrContractPaused) Error ¶
func (e ErrContractPaused) Error() string
type Manager ¶
type Manager struct { Registry *Registry Submitter Submitter // contains filtered or unexported fields }
func NewWithRetries ¶
func (Manager) Processing ¶
Processing returns true if the token is processing or enqueued.
func (Manager) StartProcessing ¶
func (m Manager) StartProcessing(ctx context.Context, td db.TokenDefinition, attempts int, cause persist.ProcessingCause) (func(db.TokenMedia, error) error, error)
StartProcessing marks a token as processing. It returns a callback that must be called when work on the token is finished in order to mark it as finished. If withRetry is true, the callback will attempt to reenqueue the token if an error is passed. attemps is ignored when MaxRetries is set to the default value of 0.
type Submitter ¶
type Submitter interface { // Handles how new tokens to Gallery should be processed SubmitNewTokens(ctx context.Context, tokenDefinitionIDs []persist.DBID) error // Handles how a token that is up for retry should be processed SubmitTokenForRetry(ctx context.Context, tokenDefinitionID persist.DBID, attempt int, delayFor time.Duration) error }
type TickTokenF ¶
type TickTokenF func(db.TokenDefinition) (time.Duration, error)
TickTokenF marks a token as ran and returns the wait time before it can be run again