-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add from_senders
for the Sync Client
#779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and your patience!
Can you please add the same changes for v5/client
as well? so we can stay consistent!
Yeah absolutely! |
any updates @BKDaugherty ? |
The `from_senders` method used to take a pair of channels, but now it only takes one. Let's update the doc comment.
The `AsyncClient` has a `from_senders` method that can be used to create a Fake client for dependency injection. Let's surface a similar method for the sync client
dbdd540
to
530da3f
Compare
Hey! Sorry @swanandx, I was AFK a bit for the holidays. Just updated to add this to the v5 client as well! Is there a proposal at all for unifying these? Would be curious to see that |
Hm. Any idea why the macos tests would fail? Doesn't seem related to this |
Oh no worries, Thank you so much!
I was thinking about it, but then how would be distinguish between v4 & v5 clients? we might need to store a field like
i don't have that idea either haha, it keeps failing randomly. so we can ignore it |
A lot of my team's code uses the synchronous client. I'd like to be able to easily write tests using a Fake Mqtt client. One easy way to do this for unit tests is by using something like the
from_senders
method that's available on theAsyncClient
. This PR adds afrom_sender
method for the sync client which can be used to write tests like the one I wrote in this PR.It also updates a stale comment on the async client.
Type of change
New feature (non-breaking change which adds functionality)
Checklist:
cargo fmt
CHANGELOG.md
if it's relevant to the users of the library. If it's not relevant mention why.