Wrapping this in simple use class #280
Unanswered
dwhiteddsoft
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hey @dwhiteddsoft, we are working on implementing an abstraction that would work something like the following: 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; I believe this is something similar to what you are suggesting above, so what are your thoughts on this? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any inherent problems getting the client and event loop into a class? I am kinda new to Rust but was simply trying to wrap all this up in a struct impl so I could hide it away from the main. Something simple like my_sruct::start
But for what ever reason when I move the same code works in the mainloop to a struct impl I can never even get connected? Any thoughts? I know this is vague and I am ok with vague answers or asks for clarity
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions