pub struct MoqEventOrigin { /* private fields */ }Expand description
Shared moq origin for the event bus plane.
Replaces the ZMQ XPUB/XSUB ProxyService. Publishers register broadcasts
under local/events/{source}; subscribers watch the origin consumer for
announcements and subscribe to the events track of each source broadcast.
Implementations§
Source§impl MoqEventOrigin
impl MoqEventOrigin
Sourcepub fn from_pair(producer: OriginProducer, consumer: OriginConsumer) -> Self
pub fn from_pair(producer: OriginProducer, consumer: OriginConsumer) -> Self
Create from an existing producer/consumer pair (e.g. shared with the iroh moq substrate so external relay subscribers see the same tree).
Sourcepub fn publisher(&self, source: &str) -> Result<MoqEventPublisher>
pub fn publisher(&self, source: &str) -> Result<MoqEventPublisher>
Create an event publisher for source (e.g. "worker", "system").
Registers the broadcast local/events/{source} and opens its events track.
Sourcepub fn publisher_with_oid(
&self,
source: &str,
oid: &str,
) -> Result<MoqEventPublisher>
pub fn publisher_with_oid( &self, source: &str, oid: &str, ) -> Result<MoqEventPublisher>
Create an event publisher for source (e.g. "worker", "system") that
ALSO mirrors every event to the per-OID (#393) publication track for oid.
This is the transition path: the publisher writes each event to BOTH the
legacy flat local/events/{source} broadcast (so existing subscribers
keep working) AND the selective local/events/publications/{oid_hash}
broadcast (so #393 subscribers get wire-level per-OID selectivity). Once
all subscribers have migrated to per-OID tracks the flat mirror can be
dropped (see MoqEventOrigin::publisher_oid_only).
oid is the model OID whose publications this publisher emits; it is
hashed via oid_hash for the broadcast path.
Sourcepub fn publisher_oid_only(
&self,
source: &str,
oid: &str,
) -> Result<MoqEventPublisher>
pub fn publisher_oid_only( &self, source: &str, oid: &str, ) -> Result<MoqEventPublisher>
Create an event publisher that writes ONLY to the per-OID (#393)
publication track for oid — no flat-track mirror. Use once every
subscriber of this source has migrated to per-OID subscription.
source is retained for topic-prefix semantics and publish() topic
construction, but nothing is announced under local/events/{source}.
Trait Implementations§
Source§impl Clone for MoqEventOrigin
impl Clone for MoqEventOrigin
Source§fn clone(&self) -> MoqEventOrigin
fn clone(&self) -> MoqEventOrigin
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MoqEventOrigin
impl !RefUnwindSafe for MoqEventOrigin
impl Send for MoqEventOrigin
impl Sync for MoqEventOrigin
impl Unpin for MoqEventOrigin
impl UnsafeUnpin for MoqEventOrigin
impl !UnwindSafe for MoqEventOrigin
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more