pub struct PolymarketMarketPoolHandle { /* private fields */ }Expand description
Cloneable routing handle used from spawned subscription tasks.
Routes each asset to its owning shard and grows the pool on demand.
Implementations§
Source§impl PolymarketMarketPoolHandle
impl PolymarketMarketPoolHandle
Sourcepub async fn subscribe_market(&self, asset_ids: Vec<String>) -> Result<()>
pub async fn subscribe_market(&self, asset_ids: Vec<String>) -> Result<()>
Subscribes to market data for the given asset IDs, sharding across connections.
§Errors
Returns an error if a shard cannot be opened or a subscribe send fails.
Sourcepub async fn unsubscribe_market(&self, asset_ids: Vec<String>) -> Result<()>
pub async fn unsubscribe_market(&self, asset_ids: Vec<String>) -> Result<()>
Removes asset IDs from their owning shards, closing emptied secondary shards.
§Errors
Returns an error if an unsubscribe send fails.
Sourcepub async fn resubscribe_market(
&self,
asset_ids: Vec<String>,
cancel: &CancellationToken,
gate: &SnapshotGate,
) -> Result<CycleMarketOutcome>
pub async fn resubscribe_market( &self, asset_ids: Vec<String>, cancel: &CancellationToken, gate: &SnapshotGate, ) -> Result<CycleMarketOutcome>
Cycles owned assets (unsubscribe then subscribe) to trigger fresh snapshots.
Unlike Self::subscribe_market, this never changes shard assignment: it routes
each asset to its owning shard, which re-subscribes it on the wire without
touching desired subscription state. The venue ignores a duplicate subscribe,
so only a real cycle produces a fresh book snapshot. Used by book recovery.
§Errors
Returns an error if the pool is closed, an asset is not owned by any shard, or a cycle command send fails.
Trait Implementations§
Source§impl Clone for PolymarketMarketPoolHandle
impl Clone for PolymarketMarketPoolHandle
Auto Trait Implementations§
impl !RefUnwindSafe for PolymarketMarketPoolHandle
impl !UnwindSafe for PolymarketMarketPoolHandle
impl Freeze for PolymarketMarketPoolHandle
impl Send for PolymarketMarketPoolHandle
impl Sync for PolymarketMarketPoolHandle
impl Unpin for PolymarketMarketPoolHandle
impl UnsafeUnpin for PolymarketMarketPoolHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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