Skip to content

Commit

Permalink
Add docs on upper limit to number of events that can be published.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholassm committed Jul 31, 2024
1 parent 27f4de0 commit f588a51
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ impl<'a, E> Iterator for MutBatchIter<'a, E> {
/// application before panicking.)
/// This could also be the case for a [`MissingFreeSlots`] error but not necessarily. That depends on
/// the application.
///
/// Note also, that there is a (very high) limit to how many events can be published into the Disruptor: 2^63 - 1.
/// It is the client code's responsibility to ensure this limit it never breached as it will result in undefined
/// behaviour. (There is no guard in the library against breaching the limit due to performance considerations.)
/// The limit can be avoided by e.g. dropping the Disruptor and creating a new if you have a use case where you can
/// actually reach the limit in practice.
pub trait Producer<E> {
/// Publish an Event into the Disruptor.
/// Returns a `Result` with the published sequence number or a [RingBufferFull] in case the
Expand Down

0 comments on commit f588a51

Please sign in to comment.