PubSub channel in embassy

I have difficulties understanding how exactly the PubSub-Channel in Embassy works.

My questions are:

  • How exactly are the data in the channel queued?. In the docs, I find this definition:
    pub struct PubSubChannel<M: RawMutex, T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usize> { /* private fields */ }. I presume CAP is the queue size (?). If yes, are there separate queues for each subscriber?

  • What is the difference between publish and publish_immediate? Is it that publish awaits if there is no space left in the queue, and that publish_immediate discards the oldest message and therefore never awaits?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.