rjstore

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNotFound indicates the job doesn't exists.
	ErrNotFound = errors.New("retrieval job not found")
)

Functions

This section is empty.

Types

type Store

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

Store is a persistent store for retrieval jobs.

func New

func New(ds datastore.Datastore) (*Store, error)

New returns a new retrieval job store.

func (*Store) Close

func (s *Store) Close() error

Close closes the Store, unregistering any subscribed watchers.

func (*Store) Dequeue

func (s *Store) Dequeue() (*ffs.RetrievalJob, error)

Dequeue dequeues a ready to be executed retrieval job.

func (*Store) Enqueue

func (s *Store) Enqueue(j ffs.RetrievalJob) error

Enqueue queues a new retrieval job.

func (*Store) Finalize

func (s *Store) Finalize(jid ffs.JobID, st ffs.JobStatus, jobError error) error

Finalize finalizes a retrieval job.

func (*Store) Get

func (s *Store) Get(jid ffs.JobID) (ffs.RetrievalJob, error)

Get returns the current state of a retrieval job. If doesn't exist, returns ErrNotFound.

func (*Store) Watch

func (s *Store) Watch(ctx context.Context, c chan<- ffs.RetrievalJob, iid ffs.APIID) error

Watch subscribes to retrieval job changes from a specified Api instance.

Jump to

Keyboard shortcuts

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