pub struct StartupOptions {
pub env_file: Option<String>,
pub enable_http: bool,
pub enable_jobs: bool,
pub enable_consumers: bool,
pub service_protocol: String,
pub service_weight: i32,
pub auth_type: String,
pub worker_max_execute_time_minutes: u64,
pub event_loop_max_execute_time_minutes: u64,
pub blocked_thread_check_interval_millis: u64,
pub worker_pool_size: usize,
pub event_loop_pool_size: usize,
}Expand description
Startup flags and tuning knobs for GenericStartup.
Build with StartupOptions::default_options (via Default) and the
with_* builders. worker_pool_size and event_loop_pool_size are
recorded and logged; the Tokio runtime itself is owned by the host binary.
Fields§
§env_file: Option<String>Path to the dotenv file loaded at startup. None loads .env by default lookup.
enable_http: boolWhether HTTP controllers are mounted during GenericStartup::bootstrap. Defaults to true.
enable_jobs: boolWhether GenericStartup::run_jobs starts registered jobs. Defaults to true.
enable_consumers: boolWhether queue consumers from ConsumerRegistrar are recorded during bootstrap. Defaults to false.
service_protocol: StringService scheme sent during gateway registration. Defaults to "http".
service_weight: i32Service weight sent during gateway registration. Defaults to 1.
auth_type: StringAuth type sent during gateway registration. Defaults to "token".
worker_max_execute_time_minutes: u64Maximum expected worker task duration, in minutes. Defaults to 2.
event_loop_max_execute_time_minutes: u64Maximum expected event-loop task duration, in minutes. Defaults to 1.
blocked_thread_check_interval_millis: u64Interval for blocked-thread checks, in milliseconds. Defaults to 750.
worker_pool_size: usizeWorker pool size hint, logged at startup and reported with worker counts. Defaults to 20.
event_loop_pool_size: usizeEvent-loop pool size hint, logged at startup. Defaults to 16.
Implementations§
Source§impl StartupOptions
impl StartupOptions
Sourcepub fn default_options() -> Self
pub fn default_options() -> Self
Returns the default startup flags (HTTP and jobs on, consumers off).
Sourcepub fn with_env_file(self, path: impl Into<String>) -> Self
pub fn with_env_file(self, path: impl Into<String>) -> Self
Sets the dotenv file path used by GenericStartup::init.
Sourcepub fn with_http(self, enabled: bool) -> Self
pub fn with_http(self, enabled: bool) -> Self
Sets whether HTTP controllers are mounted during bootstrap.
Sourcepub fn with_jobs(self, enabled: bool) -> Self
pub fn with_jobs(self, enabled: bool) -> Self
Sets whether GenericStartup::run_jobs starts registered jobs.
Sourcepub fn with_consumers(self, enabled: bool) -> Self
pub fn with_consumers(self, enabled: bool) -> Self
Sets whether queue consumers are recorded during bootstrap.
Trait Implementations§
Source§impl Clone for StartupOptions
impl Clone for StartupOptions
Source§impl Debug for StartupOptions
impl Debug for StartupOptions
Auto Trait Implementations§
impl Freeze for StartupOptions
impl RefUnwindSafe for StartupOptions
impl Send for StartupOptions
impl Sync for StartupOptions
impl Unpin for StartupOptions
impl UnsafeUnpin for StartupOptions
impl UnwindSafe for StartupOptions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more