pub struct RedisMessageBusDatabase {
pub trader_id: TraderId,
pub instance_id: UUID4,
/* private fields */
}
Fields§
§trader_id: TraderId
The trader ID for this message bus database.
instance_id: UUID4
The instance ID for this message bus database.
Implementations§
Source§impl RedisMessageBusDatabase
impl RedisMessageBusDatabase
Sourcepub fn get_stream_receiver(&mut self) -> Result<Receiver<BusMessage>>
pub fn get_stream_receiver(&mut self) -> Result<Receiver<BusMessage>>
Gets the stream receiver for this instance.
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 IntoPy<Py<PyAny>> for RedisMessageBusDatabase
impl IntoPy<Py<PyAny>> for RedisMessageBusDatabase
Source§impl MessageBusDatabaseAdapter for RedisMessageBusDatabase
impl MessageBusDatabaseAdapter for RedisMessageBusDatabase
Source§fn new(
trader_id: TraderId,
instance_id: UUID4,
config: MessageBusConfig,
) -> Result<Self>
fn new( trader_id: TraderId, instance_id: UUID4, config: MessageBusConfig, ) -> Result<Self>
Creates a new RedisMessageBusDatabase
instance.
Source§fn is_closed(&self) -> bool
fn is_closed(&self) -> bool
Returns whether the message bus database adapter publishing channel is closed.
Source§fn publish(&self, topic: String, payload: Bytes)
fn publish(&self, topic: String, payload: Bytes)
Publishes a message with the given topic
and payload
.
type DatabaseType = RedisMessageBusDatabase
Source§impl PyClass for RedisMessageBusDatabase
impl PyClass for RedisMessageBusDatabase
Source§impl PyClassImpl for RedisMessageBusDatabase
impl PyClassImpl for RedisMessageBusDatabase
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = SendablePyClass<RedisMessageBusDatabase>
type ThreadChecker = SendablePyClass<RedisMessageBusDatabase>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<RedisMessageBusDatabase> for PyClassImplCollector<RedisMessageBusDatabase>
impl PyClassNewTextSignature<RedisMessageBusDatabase> for PyClassImplCollector<RedisMessageBusDatabase>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a RedisMessageBusDatabase
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a RedisMessageBusDatabase
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut RedisMessageBusDatabase
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut RedisMessageBusDatabase
Source§impl PyMethods<RedisMessageBusDatabase> for PyClassImplCollector<RedisMessageBusDatabase>
impl PyMethods<RedisMessageBusDatabase> for PyClassImplCollector<RedisMessageBusDatabase>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for RedisMessageBusDatabase
impl PyTypeInfo for RedisMessageBusDatabase
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type.impl DerefToPyAny for RedisMessageBusDatabase
Auto Trait Implementations§
impl Freeze for RedisMessageBusDatabase
impl RefUnwindSafe for RedisMessageBusDatabase
impl Send for RedisMessageBusDatabase
impl Sync for RedisMessageBusDatabase
impl Unpin for RedisMessageBusDatabase
impl UnwindSafe for RedisMessageBusDatabase
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
Mutably borrows from an owned value. Read more
§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>
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