-
Notifications
You must be signed in to change notification settings - Fork 219
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
Client streaming #83
Client streaming #83
Conversation
@nat-n -- this looks like a great set of changes. That bi-directional streaming implementation is really slick! |
caa840e
to
fa54e6f
Compare
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.
Awesome work! I only found very minor improvements 🥇 👍
If its too much of a hassle to take out the parallelization of generate.py
, we could leave it in and I'll see later if I can correct the output. But it would be great if the path whitelisting could still work as before.
Including stream_unary and stream_stream call methods. Also - improve organisation of relevant tests - fix some generated type annotations - Add AsyncChannel utility cos it's useful
- Fix issue with __pycache__ dirs getting picked up - parallelise code generation with asyncio for 3x speedup - silence protoc output unless -v option is supplied - Use pathlib ;)
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.
Some things are not working yet. I am making a PR with test-cases :-)
Client streaming tests
Hi, just curious why parallelizing the generator script was necessary? It seemed fast enough already (it took like 5 seconds on my laptop). Previously I was just using ptvsd, but that doesn't work now since there can't be multiple debug servers on a single port, so it's now much harder to debug. I think this is the PR where the change was implemented. |
@adament The generator was slow enough to be annoying before. As I recall it this change more than halved the time taken to generate all the test cases though I can't remember the specific times. What are you trying to debug exactly? the plugin as called by protoc? If you need to be able to run generate with only one concurrent call to protoc then I think it shouldn't be too hard to add an option for that (similar to the -v option). Basically it would just need to switch the two calls to asyncio.gather for a function with the same signature that instead runs the given coroutines in series. |
If it was slow enough to be annoying, then yeah this change is warranted. For me the time it took was totally bearable, but maybe I have a fast CPU 🚤
Yes, precisely.
Yup that would be nice! |
Picks up where #45 left off. @hozn