-
Notifications
You must be signed in to change notification settings - Fork 37
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
Tokio-core migration #4
Conversation
Upgrading byteorder v1.2 -> v1.3 Upgrading hostname v0.2 -> v0.3 Upgrading multimap v0.4 -> v0.8 Upgrading rand v0.5 -> v0.7
@ashthespy Fine by me, first work I have done with the new futures. Would client functionality be a reasonable thing to bring into this project as a feature / sub crate? It would be good to have a single well maintained mdns crate in the ecosystem as it's a bit scattered at the moment. Anything avahi based is a bit of a nightmare for embedded as it's a pig to build. |
Btw, what is the case that requires the loop (1ef93ec) I didn't see a need for that loop my tests/and with PS: To be honest, my first work with the new stuff as well, and I struggled until I found the tokio discord ;-) |
Without the loop for recv the task may not wake on subsequent recv. If you test it with a number of clients it's easy to reproduce. |
Hmm, at some point during my testing I dropped the loop while I was playing with an async version with |
Hi, thanks for looking into this. And thanks for the ping @ashthespy it turns out I'd never enabled notifications for this repo... so I'd completely missed the activity. My original agenda was to try and get the DNS packet stuff from an external crate (so basically upstream changes to dns_parser) before doing anything else. But dns_parser has diverged a lot since plietar originally did the packet building, and now looks kind of abandoned. So I've just formatted the whole repo (including dns_parser), and made the rust 2018 edition bump in master. Hopefully that'll help reduce the noise in these diffs once re-based. I'll have a go at the re-base in a bit, since the churn is my fault :) An mDNS client is definitely welcome in this crate @ryanpresciense . I'm not sure about a feature as it's likely a project would only need a client OR a responder. Meaning both should be features... then |
Ok I have pushed https://github.com/librespot-org/libmdns/tree/tokio-0.1 and https://github.com/librespot-org/libmdns/tree/tokio-0.2 to this main repo, which are your commits rebased onto master, Ash Could you update this PR to those commits? CI passes, and it looks like your changes are pretty reasonable, but it would still be nice to see a PR without the formatting noise :) |
Will have a look tomorrow, thanks! |
@willstott101 I'm not sure what I should do now - both the branches looks like they already have the relevant commits in them? |
Yeah I guess that didn't make much sense, I've created a PR for my re-written commits myself. Let me know if it looks ok to both of you. And we can merge it in. |
Migrated the crate over from
tokio-core
totokio
0.1 and then to 0.2. These are both breaking changes. I am not sure if we should supporttokio
0.1 and 0.2 with correspondinglibmdns
0.3 and 0.4 versions, or go directly totokio
0.2.In the bigger (non
librespot
) view, we might want to consider making the library executor agnostic, so eitherasync-std
ortokio
or anything else can be used.@ryanpresciense I'd prefer this over the
pin-project
approach of #3, unless you see any issues?We can add in the v4/v6 changes in a separate PR.
FWIW, I also migrated
librespot
over from tokio-core to tokio 0.1, and this works well with it, but would rather bite the bullet and get it ontotokio
0.2 and friends (hyper
0.13,futures
0.3)