Documentation ¶
Index ¶
- type Local
- func (l *Local) CurrentlyQueuedTasksCount(_ context.Context) (count uint64, err error)
- func (l *Local) DelMetric(_ context.Context, k schemas.MetricKey) error
- func (l *Local) ExecutedTasksCount(_ context.Context) (uint64, error)
- func (l *Local) GetMetric(ctx context.Context, m *schemas.Metric) error
- func (l *Local) MetricExists(_ context.Context, k schemas.MetricKey) (bool, error)
- func (l *Local) Metrics(_ context.Context) (metrics schemas.Metrics, err error)
- func (l *Local) MetricsCount(_ context.Context) (int64, error)
- func (l *Local) QueueTask(_ context.Context, tt schemas.TaskType, uniqueID, _ string) (bool, error)
- func (l *Local) SetMetric(_ context.Context, m schemas.Metric) error
- func (l *Local) UnqueueTask(_ context.Context, tt schemas.TaskType, uniqueID string) error
- type Redis
- func (r *Redis) CurrentlyQueuedTasksCount(ctx context.Context) (count uint64, err error)
- func (r *Redis) DelMetric(ctx context.Context, k schemas.MetricKey) error
- func (r *Redis) ExecutedTasksCount(ctx context.Context) (uint64, error)
- func (r *Redis) GetMetric(ctx context.Context, m *schemas.Metric) error
- func (r *Redis) KeepaliveExists(ctx context.Context, uuid string) (bool, error)
- func (r *Redis) MetricExists(ctx context.Context, k schemas.MetricKey) (bool, error)
- func (r *Redis) Metrics(ctx context.Context) (schemas.Metrics, error)
- func (r *Redis) MetricsCount(ctx context.Context) (int64, error)
- func (r *Redis) QueueTask(ctx context.Context, tt schemas.TaskType, taskUUID, processUUID string) (set bool, err error)
- func (r *Redis) SetKeepalive(ctx context.Context, uuid string, ttl time.Duration) (bool, error)
- func (r *Redis) SetMetric(ctx context.Context, m schemas.Metric) error
- func (r *Redis) UnqueueTask(ctx context.Context, tt schemas.TaskType, taskUUID string) (err error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func (*Local) CurrentlyQueuedTasksCount ¶
CurrentlyQueuedTasksCount ..
func (*Local) ExecutedTasksCount ¶
ExecutedTasksCount ..
func (*Local) MetricExists ¶
MetricExists ..
func (*Local) MetricsCount ¶
MetricsCount ..
func (*Local) QueueTask ¶
QueueTask registers that we are queueing the task. It returns true if it managed to schedule it, false if it was already scheduled.
type Redis ¶
type Redis struct {
*redis.Client
}
Redis ..
func (*Redis) CurrentlyQueuedTasksCount ¶
CurrentlyQueuedTasksCount ..
func (*Redis) ExecutedTasksCount ¶
ExecutedTasksCount ..
func (*Redis) KeepaliveExists ¶
KeepaliveExists returns whether a keepalive exists or not for a particular UUID.
func (*Redis) MetricExists ¶
MetricExists ..
func (*Redis) MetricsCount ¶
MetricsCount ..
func (*Redis) QueueTask ¶
func (r *Redis) QueueTask(ctx context.Context, tt schemas.TaskType, taskUUID, processUUID string) (set bool, err error)
QueueTask registers that we are queueing the task. It returns true if it managed to schedule it, false if it was already scheduled.
func (*Redis) SetKeepalive ¶
SetKeepalive sets a key with an UUID corresponding to the currently running process.
type Store ¶
type Store interface { // Metrics .. Metrics(context.Context) (schemas.Metrics, error) SetMetric(context.Context, schemas.Metric) error DelMetric(context.Context, schemas.MetricKey) error GetMetric(context.Context, *schemas.Metric) error MetricExists(context.Context, schemas.MetricKey) (bool, error) MetricsCount(context.Context) (int64, error) // QueueTask Helpers to keep track of currently queued tasks and avoid scheduling them // twice at the risk of ending up with loads of dangling goroutines being locked QueueTask(context.Context, schemas.TaskType, string, string) (bool, error) UnqueueTask(context.Context, schemas.TaskType, string) error CurrentlyQueuedTasksCount(context.Context) (uint64, error) ExecutedTasksCount(context.Context) (uint64, error) }
Store ..
Click to show internal directories.
Click to hide internal directories.