pub struct SubscriptionPoller { /* private fields */ }Expand description
Subscription poller that consumes subscription data and delivers via a delivery trait.
Implementations§
Source§impl SubscriptionPoller
impl SubscriptionPoller
Sourcepub fn new(batch_size: usize) -> Self
pub fn new(batch_size: usize) -> Self
Create a new subscription poller.
§Arguments
batch_size- Maximum number of rows to read per subscription per poll cycle
Sourcepub fn register(&self, subscription_id: SubscriptionId)
pub fn register(&self, subscription_id: SubscriptionId)
Register a new subscription for polling.
Should be called when a client subscribes.
Sourcepub fn unregister(&self, subscription_id: &SubscriptionId)
pub fn unregister(&self, subscription_id: &SubscriptionId)
Unregister a subscription from polling.
Should be called when a client unsubscribes or disconnects.
Sourcepub fn poll_all(
&self,
engine: &StandardEngine,
system: &ActorSystem,
delivery: &dyn SubscriptionDelivery,
)
pub fn poll_all( &self, engine: &StandardEngine, system: &ActorSystem, delivery: &dyn SubscriptionDelivery, )
Poll all active subscriptions and deliver data via the delivery trait.
Sourcepub async fn run_loop(
self: Arc<Self>,
engine: StandardEngine,
system: ActorSystem,
delivery: Arc<dyn SubscriptionDelivery + Send + Sync>,
poll_interval: Duration,
stop_rx: Receiver<bool>,
)
pub async fn run_loop( self: Arc<Self>, engine: StandardEngine, system: ActorSystem, delivery: Arc<dyn SubscriptionDelivery + Send + Sync>, poll_interval: Duration, stop_rx: Receiver<bool>, )
Run the poller loop. Returns when the stop signal is received.
Auto Trait Implementations§
impl !Freeze for SubscriptionPoller
impl !RefUnwindSafe for SubscriptionPoller
impl Send for SubscriptionPoller
impl Sync for SubscriptionPoller
impl Unpin for SubscriptionPoller
impl UnsafeUnpin for SubscriptionPoller
impl UnwindSafe for SubscriptionPoller
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request