pub struct RedisMessageBusBacking {
pub trader_id: TraderId,
pub instance_id: UUID4,
/* private fields */
}Fields§
§trader_id: TraderIdThe trader ID for this message bus backing.
instance_id: UUID4The instance ID for this message bus backing.
Implementations§
Source§impl RedisMessageBusBacking
impl RedisMessageBusBacking
Sourcepub fn new(
trader_id: TraderId,
instance_id: UUID4,
config: MessageBusConfig,
backing: RedisMessageBusConfig,
) -> Result<Self>
pub fn new( trader_id: TraderId, instance_id: UUID4, config: MessageBusConfig, backing: RedisMessageBusConfig, ) -> Result<Self>
Creates a new RedisMessageBusBacking instance for the given trader_id, instance_id, and config.
§Errors
Returns an error if the heartbeat interval is configured as zero seconds.
Source§impl RedisMessageBusBacking
impl RedisMessageBusBacking
Sourcepub fn get_stream_receiver(&mut self) -> Result<Receiver<BusMessage>>
pub fn get_stream_receiver(&mut self) -> Result<Receiver<BusMessage>>
Retrieves the Redis stream receiver for this message bus instance.
§Errors
Returns an error if the stream receiver has already been taken.
Sourcepub fn stream(
stream_rx: Receiver<BusMessage>,
) -> impl Stream<Item = BusMessage> + 'static
pub fn stream( stream_rx: Receiver<BusMessage>, ) -> impl Stream<Item = BusMessage> + 'static
Streams messages arriving on the stream receiver channel.
pub async fn close_async(&mut self)
Trait Implementations§
Source§impl Debug for RedisMessageBusBacking
impl Debug for RedisMessageBusBacking
Source§impl MessageBusBacking for RedisMessageBusBacking
impl MessageBusBacking for RedisMessageBusBacking
Source§fn is_closed(&self) -> bool
fn is_closed(&self) -> bool
Returns whether the message bus backing publishing channel is closed.
Source§fn publish(&self, message: BusMessage)
fn publish(&self, message: BusMessage)
Queues a serialized bus message for external publication.
Source§fn take_receiver(&mut self) -> Result<Receiver<BusMessage>>
fn take_receiver(&mut self) -> Result<Receiver<BusMessage>>
Takes the inbound message receiver for live bridge consumption. Read more
Auto Trait Implementations§
impl Freeze for RedisMessageBusBacking
impl RefUnwindSafe for RedisMessageBusBacking
impl Send for RedisMessageBusBacking
impl Sync for RedisMessageBusBacking
impl Unpin for RedisMessageBusBacking
impl UnsafeUnpin for RedisMessageBusBacking
impl UnwindSafe for RedisMessageBusBacking
Blanket Implementations§
impl<T> Allocation for T
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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