changes: made client public,

also renamed client  AMQPWorker -> BunBunClient
This commit is contained in:
2005 2024-10-24 20:58:13 +02:00
parent d83ad8141c
commit 844f6214f8
3 changed files with 6 additions and 6 deletions

View file

@ -18,11 +18,11 @@ use crate::ResultHeader;
/// With this client you can send messages to a queue that other microservices /// With this client you can send messages to a queue that other microservices
/// will process /// will process
#[derive(Debug)] #[derive(Debug)]
pub struct AMQPClient { pub struct BunBunClient {
conn: Connection, conn: Connection,
} }
impl AMQPClient { impl BunBunClient {
/// Creates an rpc client /// Creates an rpc client
/// ///
/// # Examples /// # Examples

View file

@ -16,7 +16,7 @@ use std::{
sync::Arc, sync::Arc,
}; };
use tokio::sync::Mutex; use tokio::sync::Mutex;
mod client; pub mod client;
mod test; mod test;
pub struct BunBunWorker { pub struct BunBunWorker {

View file

@ -10,7 +10,7 @@ mod test {
use tracing_test::traced_test; use tracing_test::traced_test;
use crate::{ use crate::{
client::{AMQPClient, RPCClientTask}, client::{BunBunClient, RPCClientTask},
BunBunWorker, RPCServerTask, BunBunWorker, RPCServerTask,
}; };
@ -117,7 +117,7 @@ mod test {
#[traced_test] #[traced_test]
async fn rpc_client() { async fn rpc_client() {
// //
let mut client = AMQPClient::new(env::var("AMQP_SERVER_URL").unwrap().as_str()) let mut client = BunBunClient::new(env::var("AMQP_SERVER_URL").unwrap().as_str())
.await .await
.unwrap(); .unwrap();
let result = client let result = client
@ -142,7 +142,7 @@ mod test {
#[traced_test] #[traced_test]
async fn rpc_client_spam_multithread() { async fn rpc_client_spam_multithread() {
// //
let mut client = AMQPClient::new(env::var("AMQP_SERVER_URL").unwrap().as_str()) let mut client = BunBunClient::new(env::var("AMQP_SERVER_URL").unwrap().as_str())
.await .await
.unwrap(); .unwrap();
let client = Arc::new(Mutex::new(client)); let client = Arc::new(Mutex::new(client));