Documentation
¶
Overview ¶
Package memattempt provides the concurrency-safe in-memory reference implementation of learning.AttemptRepository.
Index ¶
- type Store
- func (s *Store) Abandon(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, error)
- func (s *Store) AcquireClaim(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, learning.AttemptClaim, error)
- func (s *Store) Checkpoint(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, error)
- func (s *Store) Create(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, error)
- func (s *Store) Delete(ctx context.Context, partition learning.AttemptPartition, ...) error
- func (s *Store) DeleteTerminalOlderThan(ctx context.Context, partition learning.AttemptPartition, ...) (int, error)
- func (s *Store) DiscoverWork(ctx context.Context, query learning.AttemptWorkList) (learning.AttemptWorkPage, error)
- func (s *Store) Finalize(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, error)
- func (s *Store) Get(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, bool, error)
- func (s *Store) List(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptPage, error)
- func (s *Store) ReleaseClaim(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, error)
- func (s *Store) RenewClaim(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, learning.AttemptClaim, error)
- func (s *Store) Retry(ctx context.Context, partition learning.AttemptPartition, ...) (learning.AttemptRecord, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory AttemptRepository. All lifecycle mutations are serialized so version and claim checks are atomic.
func (*Store) Abandon ¶
func (s *Store) Abandon(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion) (learning.AttemptRecord, error)
func (*Store) AcquireClaim ¶
func (s *Store) AcquireClaim(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion, duration time.Duration) (learning.AttemptRecord, learning.AttemptClaim, error)
func (*Store) Checkpoint ¶
func (s *Store) Checkpoint(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion, claim learning.AttemptClaim, checkpoint learning.AttemptCheckpoint) (learning.AttemptRecord, error)
func (*Store) Create ¶
func (s *Store) Create(ctx context.Context, partition learning.AttemptPartition, create learning.AttemptCreate) (learning.AttemptRecord, error)
func (*Store) Delete ¶
func (s *Store) Delete(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion) error
func (*Store) DeleteTerminalOlderThan ¶
func (*Store) DiscoverWork ¶
func (s *Store) DiscoverWork(ctx context.Context, query learning.AttemptWorkList) (learning.AttemptWorkPage, error)
func (*Store) Finalize ¶
func (s *Store) Finalize(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion, claim learning.AttemptClaim, final learning.AttemptFinalization) (learning.AttemptRecord, error)
func (*Store) List ¶
func (s *Store) List(ctx context.Context, partition learning.AttemptPartition, query learning.AttemptList) (learning.AttemptPage, error)
func (*Store) ReleaseClaim ¶
func (s *Store) ReleaseClaim(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion, claim learning.AttemptClaim) (learning.AttemptRecord, error)
func (*Store) RenewClaim ¶
func (s *Store) RenewClaim(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion, claim learning.AttemptClaim, duration time.Duration) (learning.AttemptRecord, learning.AttemptClaim, error)
func (*Store) Retry ¶
func (s *Store) Retry(ctx context.Context, partition learning.AttemptPartition, id learning.AttemptID, expected learning.AttemptVersion) (learning.AttemptRecord, error)
Click to show internal directories.
Click to hide internal directories.