datum-agent 0.9.2

Embeddable Datum job registry and lifecycle supervisor
Documentation
use thiserror::Error;

/// Result type used by `datum-agent`.
pub type AgentResult<T> = Result<T, AgentError>;

/// Errors returned by the embeddable agent and job registry.
#[derive(Debug, Error)]
pub enum AgentError {
    #[error("registry actor is closed")]
    RegistryClosed,
    #[error("registry actor failed: {0}")]
    Actor(String),
    #[error("invalid job name")]
    InvalidJobName,
    #[error("job already exists: {0}")]
    JobAlreadyExists(String),
    #[error("job not found: {0}")]
    JobNotFound(String),
    #[error("job is already running: {0}")]
    JobAlreadyRunning(String),
    #[error("job is not running: {0}")]
    JobNotRunning(String),
    #[error("job does not support graceful drain: {0}")]
    DrainUnsupported(String),
    #[error("restart limit exceeded for job: {0}")]
    RestartLimitExceeded(String),
    #[error(transparent)]
    Stream(#[from] datum::StreamError),
}