|
|
|
@ -8,7 +8,7 @@ use broker_task::{
@@ -8,7 +8,7 @@ use broker_task::{
|
|
|
|
|
SubscribeRequestSender, |
|
|
|
|
}; |
|
|
|
|
pub use message::Message; |
|
|
|
|
pub use publication::{Publication, SendError}; |
|
|
|
|
pub use publication::{Publication, PublishError}; |
|
|
|
|
pub use subscription::{RecvError, Subscription}; |
|
|
|
|
|
|
|
|
|
use futures::executor::block_on; |
|
|
|
@ -98,9 +98,9 @@ mod test {
@@ -98,9 +98,9 @@ mod test {
|
|
|
|
|
let mut sub = orsb.subscribe_blocking::<TestMsg>().unwrap(); |
|
|
|
|
let mut publ = orsb.advertise_blocking::<TestMsg>().unwrap(); |
|
|
|
|
|
|
|
|
|
publ.send(TestMsg(10)).unwrap(); |
|
|
|
|
publ.send(TestMsg(20)).unwrap(); |
|
|
|
|
publ.send(TestMsg(30)).unwrap(); |
|
|
|
|
publ.publish(TestMsg(10)).unwrap(); |
|
|
|
|
publ.publish(TestMsg(20)).unwrap(); |
|
|
|
|
publ.publish(TestMsg(30)).unwrap(); |
|
|
|
|
|
|
|
|
|
assert_eq!(sub.recv_blocking(), Ok(TestMsg(10))); |
|
|
|
|
assert_eq!(sub.recv_blocking(), Ok(TestMsg(20))); |
|
|
|
@ -120,9 +120,9 @@ mod test {
@@ -120,9 +120,9 @@ mod test {
|
|
|
|
|
let mut sub = orsb.subscribe::<TestMsg>().await.unwrap(); |
|
|
|
|
let mut publ = orsb.advertise::<TestMsg>().await.unwrap(); |
|
|
|
|
|
|
|
|
|
publ.send(TestMsg(10)).unwrap(); |
|
|
|
|
publ.send(TestMsg(20)).unwrap(); |
|
|
|
|
publ.send(TestMsg(30)).unwrap(); |
|
|
|
|
publ.publish(TestMsg(10)).unwrap(); |
|
|
|
|
publ.publish(TestMsg(20)).unwrap(); |
|
|
|
|
publ.publish(TestMsg(30)).unwrap(); |
|
|
|
|
|
|
|
|
|
assert_eq!(sub.recv().await, Ok(TestMsg(10))); |
|
|
|
|
assert_eq!(sub.recv().await, Ok(TestMsg(20))); |
|
|
|
|