asynq 0.1.8

Simple, reliable & efficient distributed task queue in Rust, inspired by hibiken/asynq
Documentation
// This file is @generated by prost-build.
/// TaskMessage is the internal representation of a task with additional
/// metadata fields.
/// Next ID: 16
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct TaskMessage {
    /// Type indicates the kind of the task to be performed.
    #[prost(string, tag = "1")]
    pub r#type: ::prost::alloc::string::String,
    /// Payload holds data needed to process the task.
    #[prost(bytes = "vec", tag = "2")]
    pub payload: ::prost::alloc::vec::Vec<u8>,
    /// Headers holds additional metadata for the task.
    #[prost(map = "string, string", tag = "15")]
    pub headers: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Unique identifier for the task.
    #[prost(string, tag = "3")]
    pub id: ::prost::alloc::string::String,
    /// Name of the queue to which this task belongs.
    #[prost(string, tag = "4")]
    pub queue: ::prost::alloc::string::String,
    /// Max number of retries for this task.
    #[prost(int32, tag = "5")]
    pub retry: i32,
    /// Number of times this task has been retried so far.
    #[prost(int32, tag = "6")]
    pub retried: i32,
    /// Error message from the last failure.
    #[prost(string, tag = "7")]
    pub error_msg: ::prost::alloc::string::String,
    /// Time of last failure in Unix time,
    /// the number of seconds elapsed since January 1, 1970 UTC.
    /// Use zero to indicate no last failure.
    #[prost(int64, tag = "11")]
    pub last_failed_at: i64,
    /// Timeout specifies timeout in seconds.
    /// Use zero to indicate no timeout.
    #[prost(int64, tag = "8")]
    pub timeout: i64,
    /// Deadline specifies the deadline for the task in Unix time,
    /// the number of seconds elapsed since January 1, 1970 UTC.
    /// Use zero to indicate no deadline.
    #[prost(int64, tag = "9")]
    pub deadline: i64,
    /// UniqueKey holds the redis key used for uniqueness lock for this task.
    /// Empty string indicates that no uniqueness lock was used.
    #[prost(string, tag = "10")]
    pub unique_key: ::prost::alloc::string::String,
    /// GroupKey is a name of the group used for task aggregation.
    /// This field is optional and empty value means no aggregation for the task.
    #[prost(string, tag = "14")]
    pub group_key: ::prost::alloc::string::String,
    /// Retention period specified in a number of seconds.
    /// The task will be stored in redis as a completed task until the TTL
    /// expires.
    #[prost(int64, tag = "12")]
    pub retention: i64,
    /// Time when the task completed in success in Unix time,
    /// the number of seconds elapsed since January 1, 1970 UTC.
    /// This field is populated if result_ttl > 0 upon completion.
    #[prost(int64, tag = "13")]
    pub completed_at: i64,
}
/// ServerInfo holds information about a running server.
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct ServerInfo {
    /// Host machine the server is running on.
    #[prost(string, tag = "1")]
    pub host: ::prost::alloc::string::String,
    /// PID of the server process.
    #[prost(int32, tag = "2")]
    pub pid: i32,
    /// Unique identifier for this server.
    #[prost(string, tag = "3")]
    pub server_id: ::prost::alloc::string::String,
    /// Maximum number of concurrency this server will use.
    #[prost(int32, tag = "4")]
    pub concurrency: i32,
    /// List of queue names with their priorities.
    /// The server will consume tasks from the queues and prioritize
    /// queues with higher priority numbers.
    #[prost(map = "string, int32", tag = "5")]
    pub queues: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
    /// If set, the server will always consume tasks from a queue with higher
    /// priority.
    #[prost(bool, tag = "6")]
    pub strict_priority: bool,
    /// Status indicates the status of the server.
    #[prost(string, tag = "7")]
    pub status: ::prost::alloc::string::String,
    /// Time this server was started.
    #[prost(message, optional, tag = "8")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Number of workers currently processing tasks.
    #[prost(int32, tag = "9")]
    pub active_worker_count: i32,
}
/// WorkerInfo holds information about a running worker.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
#[prost(skip_debug)]
pub struct WorkerInfo {
    /// Host matchine this worker is running on.
    #[prost(string, tag = "1")]
    pub host: ::prost::alloc::string::String,
    /// PID of the process in which this worker is running.
    #[prost(int32, tag = "2")]
    pub pid: i32,
    /// ID of the server in which this worker is running.
    #[prost(string, tag = "3")]
    pub server_id: ::prost::alloc::string::String,
    /// ID of the task this worker is processing.
    #[prost(string, tag = "4")]
    pub task_id: ::prost::alloc::string::String,
    /// Type of the task this worker is processing.
    #[prost(string, tag = "5")]
    pub task_type: ::prost::alloc::string::String,
    /// Payload of the task this worker is processing.
    #[prost(bytes = "vec", tag = "6")]
    pub task_payload: ::prost::alloc::vec::Vec<u8>,
    /// Name of the queue the task the worker is processing belongs.
    #[prost(string, tag = "7")]
    pub queue: ::prost::alloc::string::String,
    /// Time this worker started processing the task.
    #[prost(message, optional, tag = "8")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Deadline by which the worker needs to complete processing
    /// the task. If worker exceeds the deadline, the task will fail.
    #[prost(message, optional, tag = "9")]
    pub deadline: ::core::option::Option<::prost_types::Timestamp>,
}
/// SchedulerEntry holds information about a periodic task registered
/// with a scheduler.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
#[prost(skip_debug)]
pub struct SchedulerEntry {
    /// Identifier of the scheduler entry.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Periodic schedule spec of the entry.
    #[prost(string, tag = "2")]
    pub spec: ::prost::alloc::string::String,
    /// Task type of the periodic task.
    #[prost(string, tag = "3")]
    pub task_type: ::prost::alloc::string::String,
    /// Task payload of the periodic task.
    #[prost(bytes = "vec", tag = "4")]
    pub task_payload: ::prost::alloc::vec::Vec<u8>,
    /// Options used to enqueue the periodic task.
    #[prost(string, repeated, tag = "5")]
    pub enqueue_options: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Next time the task will be enqueued.
    #[prost(message, optional, tag = "6")]
    pub next_enqueue_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Last time the task was enqueued.
    /// Zero time if task was never enqueued.
    #[prost(message, optional, tag = "7")]
    pub prev_enqueue_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// SchedulerEnqueueEvent holds information about an enqueue event
/// by a scheduler.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
#[prost(skip_debug)]
pub struct SchedulerEnqueueEvent {
    /// ID of the task that was enqueued.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Time the task was enqueued.
    #[prost(message, optional, tag = "2")]
    pub enqueue_time: ::core::option::Option<::prost_types::Timestamp>,
}