pub struct Consumer<T>where
T: Transport + 'static,{ /* private fields */ }Expand description
Subscription consumer
Implementations§
Source§impl<T> Consumer<T>where
T: Transport + 'static,
impl<T> Consumer<T>where
T: Transport + 'static,
Sourcepub fn new(
transport: T,
prefer_polling: bool,
context: <T::Spec as Spec>::Context,
) -> Arc<Self>
pub fn new( transport: T, prefer_polling: bool, context: <T::Spec as Spec>::Context, ) -> Arc<Self>
Creates a new instance
Sourcepub fn subscribe<I>(
self: &Arc<Self>,
request: I,
) -> Result<RemoteActiveConsumer<T>, Error>where
I: SubscriptionRequest<Topic = <T::Spec as Spec>::Topic, SubscriptionId = <T::Spec as Spec>::SubscriptionId>,
pub fn subscribe<I>(
self: &Arc<Self>,
request: I,
) -> Result<RemoteActiveConsumer<T>, Error>where
I: SubscriptionRequest<Topic = <T::Spec as Spec>::Topic, SubscriptionId = <T::Spec as Spec>::SubscriptionId>,
Creates a subscription
The subscriptions have two parts:
-
Will create the subscription to the remote Pubsub service, Any events will be moved to the internal pubsub
-
The internal subscription to the inner Pubsub. Because all subscriptions are going the transport, once events matches subscriptions, the inner_pubsub will receive the message and broadcasat the event.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Consumer<T>
impl<T> !RefUnwindSafe for Consumer<T>
impl<T> Send for Consumer<T>
impl<T> Sync for Consumer<T>
impl<T> Unpin for Consumer<T>
impl<T> !UnwindSafe for Consumer<T>
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