pub struct AsyncChannel {
pub channel: Channel,
pub rpc_futures: Arc<DashMap<String, Sender<Vec<u8>>>>,
pub rpc_consumer_started: Arc<AtomicBool>,
pub shutdown_notify: Arc<Notify>,
/* private fields */
}Fields§
§channel: Channel§rpc_futures: Arc<DashMap<String, Sender<Vec<u8>>>>§rpc_consumer_started: Arc<AtomicBool>§shutdown_notify: Arc<Notify>Implementations§
Source§impl AsyncChannel
impl AsyncChannel
pub fn new( channel: Channel, connection: Arc<Mutex<Connection>>, rpc_futures: Arc<DashMap<String, Sender<Vec<u8>>>>, publisher_confirms: Confirmations, auto_ack: bool, pre_fetch_count: Option<u16>, ) -> Self
pub async fn add_subscribe( &self, queue_name: &str, routing_key: &str, handler: InternalSubscribeHandler, )
pub async fn add_rpc_subscribe( &self, queue_name: &str, routing_key: &str, handler: InternalRPCHandler, )
pub async fn setup_exchange( &self, exchange_name: &str, exchange_type: &str, durable: bool, ) -> Result<(), AppError>
pub async fn publish( &self, exchange_name: &str, routing_key: &str, body: impl Into<Vec<u8>>, content_type: &str, content_encoding: ContentEncoding, delivery_mode: DeliveryMode, expiration: Option<u32>, ) -> Result<(), AppError>
Source§impl AsyncChannel
impl AsyncChannel
Source§impl AsyncChannel
impl AsyncChannel
pub async fn rpc_server( &self, handler: RPCHandler, routing_key: &str, exchange_name: &str, exchange_type: &str, queue_name: &str, response_timeout: Option<Duration>, ) -> Result<(), AppError>
pub async fn start_rpc_consumer(&self) -> Result<(), AppError>
pub async fn rpc_client( &self, exchange_name: &str, routing_key: &str, body: impl Into<Vec<u8>>, content_type: &str, content_encoding: ContentEncoding, timeout_millis: u32, delivery_mode: DeliveryMode, expiration: Option<u32>, response: Sender<Result<Vec<u8>, AppError>>, clean_message: UnboundedSender<PendingCmd>, message_id: Option<u64>, ) -> Result<(), AppError>
pub async fn dispose(&self)
Trait Implementations§
Source§impl Clone for AsyncChannel
impl Clone for AsyncChannel
Source§fn clone(&self) -> AsyncChannel
fn clone(&self) -> AsyncChannel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AsyncChannel
impl !RefUnwindSafe for AsyncChannel
impl Send for AsyncChannel
impl Sync for AsyncChannel
impl Unpin for AsyncChannel
impl UnsafeUnpin for AsyncChannel
impl !UnwindSafe for AsyncChannel
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