pub struct OperatorStatePoller { /* private fields */ }Expand description
Handle to a running operator-state poller.
Dropping the handle does not stop the task; callers must
explicitly .shutdown().await for a clean exit. Matches the
WsSubscriber handle’s semantics.
Implementations§
Source§impl OperatorStatePoller
impl OperatorStatePoller
Sourcepub fn spawn(http: HttpClient, state: Arc<RwLock<EngineState>>) -> Self
pub fn spawn(http: HttpClient, state: Arc<RwLock<EngineState>>) -> Self
Spawn a poller that writes into state every
POLL_INTERVAL. Returns immediately — the first fetch
happens in the background task on the first tick.
Sourcepub fn spawn_with_interval(
http: HttpClient,
state: Arc<RwLock<EngineState>>,
interval: Duration,
) -> Self
pub fn spawn_with_interval( http: HttpClient, state: Arc<RwLock<EngineState>>, interval: Duration, ) -> Self
Like Self::spawn with a custom interval — used by tests
that want to exercise multiple polls in a short wall-clock
window.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OperatorStatePoller
impl !RefUnwindSafe for OperatorStatePoller
impl Send for OperatorStatePoller
impl Sync for OperatorStatePoller
impl Unpin for OperatorStatePoller
impl UnsafeUnpin for OperatorStatePoller
impl !UnwindSafe for OperatorStatePoller
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