obabec / rust-mqtt

Rust native mqtt client for both std and no_std environmnents.
MIT License
43 stars 24 forks source link

Add `if_ready` variants of `receive_message` and `poll`, when `ReadReady` trait is implemented for io #40

Open trepidacious opened 4 months ago

trepidacious commented 4 months ago

Fix #39

May help with #36 and #38

trepidacious commented 4 months ago

Just realised there's alaready #35 doing a similar thing - I think that PR will require ReadReady for all connections, for me that led to tests not compiling but I may be missing something. This one adds the new features only if the connection supports ReadReady. On the other hand it might be neater to use the approach from #35 and just let the user access read_ready() to check before doing a receive, rather than building it into a new receive method?

trepidacious commented 3 months ago

@obabec Ah great, thanks for reviewing - is there anything else I need to do to allow merging this?