pub enum ConsumerStartupMode {
Immediate,
Explicit,
}Expand description
Declares when the runtime may consider a Consumer “started”.
Immediate (default) preserves the classic fire-and-forget semantics:
spawn_consumer_task returns as soon as the consumer task is spawned,
matching the behaviour of timer, file, direct and similar polling
consumers whose start() IS the lifetime loop.
Explicit is for resource-binding consumers (HTTP, WebSocket, …) whose
start() returns control only after the resource (e.g. TcpListener)
is bound and ready. The consumer MUST call ConsumerContext::mark_ready
after a successful bind so the runtime can await readiness and propagate
pre-ready start() errors as proper startup failures.
Adding this as a default-returning trait method keeps every existing
Consumer impl backward compatible.
Variants§
Immediate
Consumer’s start() IS the lifetime loop. The runtime treats the
consumer as ready the moment start() is invoked. (Default)
Explicit
Consumer binds/registers a resource inside start() and signals
readiness explicitly via ConsumerContext::mark_ready().
Trait Implementations§
Source§impl Clone for ConsumerStartupMode
impl Clone for ConsumerStartupMode
Source§fn clone(&self) -> ConsumerStartupMode
fn clone(&self) -> ConsumerStartupMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more