/// Subscribe to this publisher. Can accept a fixed amount of items.
Subscribe to this publisher. Can accept a fixed amount of items.
Subscribe to this publisher . Can accept a fixed amount of items .
pub fn subscribe<D: DurationTicks>(
        &self,
        max_size: usize,
        create_max_wait: D,
    ) -> Result<QueueSubscriber<T>, FreeRtosError> {
        let mut inner = self.inner.lock(create_max_wait)?;
        let queue = Queue::new(max_size)?;
        let id = inner.queue_next_id;
        inner.queue_next_id += 1;
        let subscriber = SubscriberInner {
            id: id,
            queue: queue,
            publisher: self.inner.clone(),
        };
        let subscriber = Arc::new(subscriber);
        inner.subscribers.push(subscriber.clone());
        Ok(QueueSubscriber { inner: subscriber })
    }
pub fn subscribe < D : DurationTicks > ( & self , max_size : usize , create_max_wait : D , ) -> Result < QueueSubscriber < T > , FreeRtosError > { let mut inner = self . inner . lock ( create_max_wait ) ? ; let queue = Queue :: new ( max_size ) ? ; let id = inner . queue_next_id ; inner . queue_next_id += 1 ; let subscriber = SubscriberInner { id : id , queue : queue , publisher : self . inner . clone ( ) , } ; let subscriber = Arc :: new ( subscriber ) ; inner . subscribers . push ( subscriber . clone ( ) ) ; Ok ( QueueSubscriber { inner : subscriber } ) }
Subscribe to this publisher.
Subscribe to this publisher .
&self
max_size
usize
create_max_wait
D