pub struct ServerConfig {
pub server_name: String,
pub worker_count: usize,
pub polling_interval: Duration,
pub job_timeout: Duration,
pub queues: Vec<String>,
pub auto_start: bool,
pub fetch_batch_size: usize,
pub enable_scheduler: bool,
pub scheduler_poll_interval: Duration,
}
Expand description
Configuration for the background job server
Fields§
§server_name: String
Server name identifier
worker_count: usize
Number of worker threads to run
polling_interval: Duration
Polling interval for checking new jobs
job_timeout: Duration
Timeout for job execution
queues: Vec<String>
Queues to process (empty means all queues)
auto_start: bool
Whether the server should start automatically
fetch_batch_size: usize
Maximum number of jobs to fetch per polling cycle
enable_scheduler: bool
Enable the job scheduler
scheduler_poll_interval: Duration
Scheduler polling interval
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn worker_count(self, count: usize) -> Self
pub fn worker_count(self, count: usize) -> Self
Set the number of workers
Sourcepub fn polling_interval(self, interval: Duration) -> Self
pub fn polling_interval(self, interval: Duration) -> Self
Set the polling interval
Sourcepub fn job_timeout(self, timeout: Duration) -> Self
pub fn job_timeout(self, timeout: Duration) -> Self
Set the job timeout
Sourcepub fn fetch_batch_size(self, size: usize) -> Self
pub fn fetch_batch_size(self, size: usize) -> Self
Set the fetch batch size
Sourcepub fn enable_scheduler(self, enable: bool) -> Self
pub fn enable_scheduler(self, enable: bool) -> Self
Enable or disable the scheduler
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more