mirror of
https://github.com/hibiken/asynq.git
synced 2025-04-22 16:50:18 +08:00
90 lines
2.0 KiB
Protocol Buffer
90 lines
2.0 KiB
Protocol Buffer
syntax = "proto3";
|
|
package asynq;
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
option go_package = "github.com/hibiken/asynq/internal/proto";
|
|
|
|
// TaskMessage is the internal representation of a task with additional metadata fields.
|
|
// See base.TaskMessage for details of each field.
|
|
message TaskMessage {
|
|
string type = 1;
|
|
|
|
bytes payload = 2;
|
|
|
|
string id = 3;
|
|
|
|
string queue = 4;
|
|
|
|
int32 retry = 5;
|
|
|
|
int32 retried = 6;
|
|
|
|
string error_msg = 7;
|
|
|
|
int64 timeout = 8;
|
|
|
|
int64 deadline = 9;
|
|
|
|
string unique_key = 10;
|
|
};
|
|
|
|
// ServerInfo holds information about a running server.
|
|
message ServerInfo {
|
|
string host = 1;
|
|
int32 pid = 2;
|
|
string server_id = 3;
|
|
int32 concurrency = 4;
|
|
map<string, int32> queues = 5;
|
|
bool strict_priority = 6;
|
|
string status = 7;
|
|
google.protobuf.Timestamp start_time = 8;
|
|
int32 active_worker_count = 9;
|
|
};
|
|
|
|
// WorkerInfo holds information about a running worker.
|
|
message WorkerInfo {
|
|
string host = 1;
|
|
int32 pid = 2;
|
|
string server_id = 3;
|
|
string task_id = 4;
|
|
string task_type = 5;
|
|
bytes task_payload = 6;
|
|
string queue = 7;
|
|
google.protobuf.Timestamp start_time = 8;
|
|
google.protobuf.Timestamp deadline = 9;
|
|
};
|
|
|
|
// SchedulerEntry holds information about a periodic task registered with a scheduler.
|
|
message SchedulerEntry {
|
|
// Identifier of the scheduler entry.
|
|
string id = 1;
|
|
|
|
// Periodic schedule spec of the entry.
|
|
string spec = 2;
|
|
|
|
// Task type of the periodic task.
|
|
string task_type = 3;
|
|
|
|
// Task payload of the periodic task.
|
|
bytes task_payload = 4;
|
|
|
|
// Options used to enqueue the periodic task.
|
|
repeated string enqueue_options = 5;
|
|
|
|
// Next time the task will be enqueued.
|
|
google.protobuf.Timestamp next_enqueue_time = 6;
|
|
|
|
// Last time the task was enqueued.
|
|
// Zero time if task was never enqueued.
|
|
google.protobuf.Timestamp prev_enqueue_time = 7;
|
|
};
|
|
|
|
// SchedulerEnqueueEvent holds information about an enqueue event by a scheduler.
|
|
message SchedulerEnqueueEvent {
|
|
// ID of the task that was enqueued.
|
|
string task_id = 1;
|
|
|
|
// Time the task was enqueued.
|
|
google.protobuf.Timestamp enqueue_time = 2;
|
|
}; |