-
Notifications
You must be signed in to change notification settings - Fork 2
Pass back heartbeat futures instead of manually spawning #3
Comments
It used to be like that, it’s an intended change. |
A new lapin release should happen in the next few days, and a new release of tokio-rustls too, I could add such a method at this moment I guess, there’s no harm in giving people some choice :) |
@Keruspe another method would be very good for the time being. Not only is it more general, but it also aids migration from the non-TLS library (because you just swap out the connection creation, and everything else stays the same). My current non-TLS setup passes the heartbeat back to the main caller, but I can't do that easily anymore when using TLS. Thank you for replying so fast! |
@Keruspe I can attempt to PR this, if you'd like, although I have the feeling you already have something in mind? |
If you want to take this one, go for it. I was basically going to add another fn to the trait and make the current one use the new one. |
Only updated internal as a proof of concept, but would that suit you? 71a4b15 |
(Will update the others and make a release once I've done a new lapin release first) |
It would be better to avoid assuming that the caller is using Tokio, by wrapping up the heartbeat future and passing it back to the caller so they can spawn it themselves. The current API is quite clunky with the whole handle concept.
It would be better if (just like the non-TLS version), I received
(client, heartbeat)
and could do whatever I want with it. This can be accomplished by usingjoin
orselect
wherever you would currently spawn something.The text was updated successfully, but these errors were encountered: