Struct netidx::subscriber::Subscriber [−][src]
create subscriptions
Implementations
impl Subscriber
[src]
pub fn new(resolver: Config, desired_auth: Auth) -> Result<Subscriber>
[src]
create a new subscriber with the specified config and desired auth
pub fn resolver(&self) -> ResolverRead
[src]
pub async fn subscribe(
&self,
batch: impl IntoIterator<Item = Path>,
timeout: Option<Duration>
) -> Vec<(Path, Result<Val>)>
[src]
&self,
batch: impl IntoIterator<Item = Path>,
timeout: Option<Duration>
) -> Vec<(Path, Result<Val>)>
Subscribe to the specified set of values.
To minimize round trips and amortize locking path resolution and subscription are done in batches. Best performance will be achieved with larger batches.
In case you are already subscribed to one or more of the paths in the batch, you will receive a reference to the existing subscription and no additional messages will be sent. However subscriber does not retain strong references to subscribed values, so if you drop all of them it will be unsubscribed.
It is safe to call this function concurrently with the same or overlapping sets of paths in the batch, only one subscription attempt will be made, and the result of that one attempt will be given to each concurrent caller upon success or failure.
The timeout, if specified, will apply to each subscription
individually. Any subscription that does not complete
successfully before the specified timeout will result in an
error, but that error will not effect other subscriptions in
the batch, which may complete successfully. If you need all or
nothing behavior, specify None for timeout and wrap the
subscribe
future in a time::timeout
.
pub async fn subscribe_one(
&self,
path: Path,
timeout: Option<Duration>
) -> Result<Val>
[src]
&self,
path: Path,
timeout: Option<Duration>
) -> Result<Val>
Subscribe to just one value. This is sufficient for a small
number of paths, but if you need to subscribe to a lot of
values it is more efficent to use subscribe
. The semantics
of this method are the same as subscribe
called with 1 path.
pub fn durable_subscribe(&self, path: Path) -> Dval
[src]
Create a durable value subscription to path
.
Batching of durable subscriptions is automatic, if you create a lot of durable subscriptions all at once they will batch.
The semantics of durable_subscribe
are the same as
subscribe, except that certain errors are caught, and
resubscriptions are attempted. see Dval
.
pub async fn flush(&self)
[src]
This will return when all pending operations are flushed out to the publishers. This is primarially used to provide pushback in the case you want to do a lot of writes, and you need pushback in case a publisher is slow to process them, however it applies to durable_subscribe and unsubscribe as well.
Trait Implementations
impl Clone for Subscriber
[src]
fn clone(&self) -> Subscriber
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Subscriber
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Subscriber
impl Send for Subscriber
impl Sync for Subscriber
impl Unpin for Subscriber
impl !UnwindSafe for Subscriber
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,