Documentation
¶
Index ¶
- type HeartbeatData
- type Heartbeater
- type Job
- type JobStatus
- type JobStorage
- type MetricsBackend
- func (m *MetricsBackend) GaugeValue(ctx context.Context, mt taskqueue.Metric) (taskqueue.MetricValue, error)
- func (m *MetricsBackend) IncrementCounter(ctx context.Context, mt taskqueue.Metric, count int, ts time.Time) error
- func (m *MetricsBackend) QueryRangeCounterValues(ctx context.Context, mt taskqueue.Metric, start, end time.Time) (taskqueue.MetricRangeValue, error)
- func (m *MetricsBackend) QueryRangeGaugeValues(ctx context.Context, mt taskqueue.Metric, start, end time.Time) (taskqueue.MetricRangeValue, error)
- func (m *MetricsBackend) RecordGauge(ctx context.Context, mt taskqueue.Metric, value float64, ts time.Time) error
- type OptFunc
- type Options
- type Queue
- func (q *Queue) Ack(ctx context.Context, job *taskqueue.Job, opts *taskqueue.AckOptions) error
- func (q *Queue) DeleteJobFromDeadQueue(ctx context.Context, queueName string, jobID string) error
- func (q *Queue) Dequeue(ctx context.Context, opts *taskqueue.DequeueOptions, count int) ([]*taskqueue.Job, error)
- func (q *Queue) Enqueue(ctx context.Context, job *taskqueue.Job, opts *taskqueue.EnqueueOptions) error
- func (q *Queue) ListDeadQueues(ctx context.Context) ([]*taskqueue.QueueInfo, error)
- func (q *Queue) ListPendingQueues(ctx context.Context) ([]*taskqueue.QueueInfo, error)
- func (q *Queue) Nack(ctx context.Context, job *taskqueue.Job, opts *taskqueue.NackOptions) error
- func (q *Queue) PageDeadQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
- func (q *Queue) PagePendingQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
- func (q *Queue) PausePendingQueue(ctx context.Context, queueName string) error
- func (q *Queue) ResumePendingQueue(ctx context.Context, queueName string) error
- type QueueWithExternalJobStorage
- func (q *QueueWithExternalJobStorage) Ack(ctx context.Context, job *taskqueue.Job, opts *taskqueue.AckOptions) error
- func (q *QueueWithExternalJobStorage) DeleteJobFromDeadQueue(ctx context.Context, queueName string, jobID string) error
- func (q *QueueWithExternalJobStorage) Dequeue(ctx context.Context, opts *taskqueue.DequeueOptions, count int) ([]*taskqueue.Job, error)
- func (q *QueueWithExternalJobStorage) Enqueue(ctx context.Context, job *taskqueue.Job, opts *taskqueue.EnqueueOptions) error
- func (q *QueueWithExternalJobStorage) ListDeadQueues(ctx context.Context) ([]*taskqueue.QueueInfo, error)
- func (q *QueueWithExternalJobStorage) ListPendingQueues(ctx context.Context) ([]*taskqueue.QueueInfo, error)
- func (q *QueueWithExternalJobStorage) Nack(ctx context.Context, job *taskqueue.Job, opts *taskqueue.NackOptions) error
- func (q *QueueWithExternalJobStorage) PageDeadQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
- func (q *QueueWithExternalJobStorage) PagePendingQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
- func (q *QueueWithExternalJobStorage) PausePendingQueue(ctx context.Context, queueName string) error
- func (q *QueueWithExternalJobStorage) ResumePendingQueue(ctx context.Context, queueName string) error
- type Store
- func (s *Store) CreateOrUpdate(ctx context.Context, job *taskqueue.Job) error
- func (s *Store) DeleteJob(ctx context.Context, jobID string) error
- func (s *Store) GetJob(ctx context.Context, jobID string) (*taskqueue.Job, error)
- func (s *Store) UpdateJobStatus(ctx context.Context, jobID string, status taskqueue.JobStatus) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeartbeatData ¶
type Heartbeater ¶
type Heartbeater struct {
// contains filtered or unexported fields
}
func NewHeartBeater ¶
func NewHeartBeater(rc redis.UniversalClient, opts ...OptFunc) *Heartbeater
func (*Heartbeater) LastHeartbeats ¶
func (s *Heartbeater) LastHeartbeats(ctx context.Context) ([]taskqueue.HeartbeatData, error)
func (*Heartbeater) RemoveHeartbeat ¶
func (s *Heartbeater) RemoveHeartbeat(ctx context.Context, workerID string) error
func (*Heartbeater) SendHeartbeat ¶
func (s *Heartbeater) SendHeartbeat(ctx context.Context, data taskqueue.HeartbeatData) error
type Job ¶
type Job struct {
ID string `redis:"id"`
QueueName string `redis:"queue_name"`
Payload []byte `redis:"payload"`
CreatedAt time.Time `redis:"created_at"`
StartedAt time.Time `redis:"started_at"`
UpdatedAt time.Time `redis:"updated_at"`
Attempts int `redis:"attempts"`
FailureReason string `redis:"failure_reason"`
Status JobStatus `redis:"status"`
ProcessedBy string `redis:"processed_by"`
}
type JobStorage ¶
type MetricsBackend ¶
type MetricsBackend struct {
// contains filtered or unexported fields
}
func NewMetricsBackend ¶
func NewMetricsBackend(client redis.UniversalClient, opts ...OptFunc) *MetricsBackend
func (*MetricsBackend) GaugeValue ¶
func (m *MetricsBackend) GaugeValue(ctx context.Context, mt taskqueue.Metric) (taskqueue.MetricValue, error)
func (*MetricsBackend) IncrementCounter ¶
func (*MetricsBackend) QueryRangeCounterValues ¶
func (m *MetricsBackend) QueryRangeCounterValues(ctx context.Context, mt taskqueue.Metric, start, end time.Time) (taskqueue.MetricRangeValue, error)
func (*MetricsBackend) QueryRangeGaugeValues ¶
func (m *MetricsBackend) QueryRangeGaugeValues(ctx context.Context, mt taskqueue.Metric, start, end time.Time) (taskqueue.MetricRangeValue, error)
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) DeleteJobFromDeadQueue ¶
func (*Queue) ListDeadQueues ¶
func (*Queue) ListPendingQueues ¶
func (*Queue) PageDeadQueue ¶
func (q *Queue) PageDeadQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
func (*Queue) PagePendingQueue ¶
func (q *Queue) PagePendingQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
func (*Queue) PausePendingQueue ¶
type QueueWithExternalJobStorage ¶
type QueueWithExternalJobStorage struct {
// contains filtered or unexported fields
}
func NewQueueWithExternalJobStorage ¶
func NewQueueWithExternalJobStorage(qclient redis.UniversalClient, s JobStorage, opts ...OptFunc) *QueueWithExternalJobStorage
func (*QueueWithExternalJobStorage) Ack ¶
func (q *QueueWithExternalJobStorage) Ack(ctx context.Context, job *taskqueue.Job, opts *taskqueue.AckOptions) error
func (*QueueWithExternalJobStorage) DeleteJobFromDeadQueue ¶
func (*QueueWithExternalJobStorage) Dequeue ¶
func (q *QueueWithExternalJobStorage) Dequeue(ctx context.Context, opts *taskqueue.DequeueOptions, count int) ([]*taskqueue.Job, error)
func (*QueueWithExternalJobStorage) Enqueue ¶
func (q *QueueWithExternalJobStorage) Enqueue(ctx context.Context, job *taskqueue.Job, opts *taskqueue.EnqueueOptions) error
func (*QueueWithExternalJobStorage) ListDeadQueues ¶
func (*QueueWithExternalJobStorage) ListPendingQueues ¶
func (*QueueWithExternalJobStorage) Nack ¶
func (q *QueueWithExternalJobStorage) Nack(ctx context.Context, job *taskqueue.Job, opts *taskqueue.NackOptions) error
func (*QueueWithExternalJobStorage) PageDeadQueue ¶
func (q *QueueWithExternalJobStorage) PageDeadQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
func (*QueueWithExternalJobStorage) PagePendingQueue ¶
func (q *QueueWithExternalJobStorage) PagePendingQueue(ctx context.Context, queueName string, p taskqueue.Pagination) (*taskqueue.QueueDetails, error)
func (*QueueWithExternalJobStorage) PausePendingQueue ¶
func (q *QueueWithExternalJobStorage) PausePendingQueue(ctx context.Context, queueName string) error
func (*QueueWithExternalJobStorage) ResumePendingQueue ¶
func (q *QueueWithExternalJobStorage) ResumePendingQueue(ctx context.Context, queueName string) error
Click to show internal directories.
Click to hide internal directories.