Open ZodiacWind opened 2 years ago
@ZodiacWind we are working on implementing an abstraction that would work something like the following: Subscribing:
let subscriber: Subscriber = client.subscriber("topic/string", QoS);
while let Some(pub) = subscriber.next().await { ... }
Publishing:
let publisher: Publisher = client.publisher("topic/string", QoS);
publisher.publish(data, retained).await;
What are your thoughts on this?
Good job 👍 . It seems that the Subscriber
is what I want. Thanks for your work. Please let me know if there is anything I can do. 😄
I have written some code as a PoC: https://github.com/bytebeamio/rumqtt/commit/150cec51553ef73c6e5128a1ba39df3141bf7792#diff-fd67087e30ee8bbba41e6c314cab2aea694c64ea2cd37b27cff20fb2f2f1a650
CC: @tekjar
I used the AsyncClient of
rumqttc
to subscribe specific topics. And I only want to handle the requests_rx only because the subscribed topics are concerned only.I know I cloud use
match
just like:(from #250) to deal with Incoming events only.
But I wonder that is there any solution or method that I can get the incoming events ONLY directly.
I really appreciate it.