Documentation ¶
Index ¶
- type Job
- type Store
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, job *jobqueue.Job) error
- func (s *Store) Delete(ctx context.Context, job *jobqueue.Job) error
- func (s *Store) List(ctx context.Context, request *jobqueue.ListRequest) (*jobqueue.ListResponse, error)
- func (s *Store) Lookup(ctx context.Context, id string) (*jobqueue.Job, error)
- func (s *Store) LookupByCorrelationID(ctx context.Context, correlationID string) ([]*jobqueue.Job, error)
- func (s *Store) Next() (*jobqueue.Job, error)
- func (s *Store) Start(b jobqueue.StartupBehaviour) error
- func (s *Store) Stats(ctx context.Context, req *jobqueue.StatsRequest) (*jobqueue.Stats, error)
- func (s *Store) Update(ctx context.Context, job *jobqueue.Job) error
- type StoreOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { ID string `bson:"_id"` Topic string State string Args *string Rank int Priority int64 Retry int MaxRetry int `bson:"max_retry"` CorrelationGroup string `bson:"correlation_group"` CorrelationID string `bson:"correlation_id"` Created int64 Started int64 Completed int64 LastMod int64 `bson:"last_mod"` }
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a MongoDB-based storage backend.
func NewStore ¶
func NewStore(mongodbURL string, options ...StoreOption) (*Store, error)
NewStore creates a new MongoDB-based storage backend.
func (*Store) List ¶
func (s *Store) List(ctx context.Context, request *jobqueue.ListRequest) (*jobqueue.ListResponse, error)
List returns a list of all jobs stored in the data store.
func (*Store) LookupByCorrelationID ¶
func (s *Store) LookupByCorrelationID(ctx context.Context, correlationID string) ([]*jobqueue.Job, error)
LookupByCorrelationID returns the details of jobs by their correlation identifier. If no such job could be found, an empty array is returned.
func (*Store) Start ¶
func (s *Store) Start(b jobqueue.StartupBehaviour) error
Start is called when the manager starts up. We ensure that stale jobs are marked as failed so that we have place for new jobs.
type StoreOption ¶
type StoreOption func(*Store)
StoreOption is an options provider for Store.
func SetCollectionName ¶
func SetCollectionName(collectionName string) StoreOption
SetCollectionName overrides the default collection name.
Click to show internal directories.
Click to hide internal directories.