lib.rs: removed the need to define a consumer tag
This commit is contained in:
parent
e78d8d1d77
commit
b0fc4e69e2
|
@ -78,7 +78,6 @@ impl BunBunWorker {
|
||||||
pub async fn add_non_rpc_consumer<J: NonRPCServerTask + 'static + Send>(
|
pub async fn add_non_rpc_consumer<J: NonRPCServerTask + 'static + Send>(
|
||||||
&mut self,
|
&mut self,
|
||||||
queue_name: &str,
|
queue_name: &str,
|
||||||
consumer_tag: &str,
|
|
||||||
state: Arc<Mutex<J::State>>,
|
state: Arc<Mutex<J::State>>,
|
||||||
) where
|
) where
|
||||||
<J as NonRPCServerTask>::State: std::marker::Send,
|
<J as NonRPCServerTask>::State: std::marker::Send,
|
||||||
|
@ -87,7 +86,7 @@ impl BunBunWorker {
|
||||||
.channel
|
.channel
|
||||||
.basic_consume(
|
.basic_consume(
|
||||||
queue_name,
|
queue_name,
|
||||||
consumer_tag,
|
"",
|
||||||
BasicConsumeOptions::default(),
|
BasicConsumeOptions::default(),
|
||||||
FieldTable::default(),
|
FieldTable::default(),
|
||||||
)
|
)
|
||||||
|
@ -125,7 +124,6 @@ impl BunBunWorker {
|
||||||
pub async fn add_rpc_consumer<J: RPCServerTask + 'static + Send>(
|
pub async fn add_rpc_consumer<J: RPCServerTask + 'static + Send>(
|
||||||
&mut self,
|
&mut self,
|
||||||
queue_name: &str,
|
queue_name: &str,
|
||||||
consumer_tag: &str,
|
|
||||||
state: Arc<Mutex<J::State>>,
|
state: Arc<Mutex<J::State>>,
|
||||||
) where
|
) where
|
||||||
<J as RPCServerTask>::State: std::marker::Send,
|
<J as RPCServerTask>::State: std::marker::Send,
|
||||||
|
@ -136,7 +134,7 @@ impl BunBunWorker {
|
||||||
.channel
|
.channel
|
||||||
.basic_consume(
|
.basic_consume(
|
||||||
queue_name,
|
queue_name,
|
||||||
consumer_tag,
|
"",
|
||||||
BasicConsumeOptions::default(),
|
BasicConsumeOptions::default(),
|
||||||
FieldTable::default(),
|
FieldTable::default(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -88,7 +88,6 @@ mod test {
|
||||||
listener
|
listener
|
||||||
.add_rpc_consumer::<EmailJob>(
|
.add_rpc_consumer::<EmailJob>(
|
||||||
"email-emailjob-v1.0.0",
|
"email-emailjob-v1.0.0",
|
||||||
"emailjob",
|
|
||||||
Arc::new(Mutex::new(State {
|
Arc::new(Mutex::new(State {
|
||||||
something: "test".into(),
|
something: "test".into(),
|
||||||
})),
|
})),
|
||||||
|
@ -107,7 +106,6 @@ mod test {
|
||||||
listener
|
listener
|
||||||
.add_rpc_consumer::<PanickingEmailJob>(
|
.add_rpc_consumer::<PanickingEmailJob>(
|
||||||
"email-emailjob-v1.0.0",
|
"email-emailjob-v1.0.0",
|
||||||
"emailjob",
|
|
||||||
Arc::new(Mutex::new(State {
|
Arc::new(Mutex::new(State {
|
||||||
something: "test".into(),
|
something: "test".into(),
|
||||||
})),
|
})),
|
||||||
|
|
Loading…
Reference in a new issue