Discussion:
[Twisted-Python] gRPC support in Twisted Python
Nursimulu, Khen
2016-09-28 13:13:58 UTC
Permalink
Hello,

Is there a plan (or an implementation) to support gRPC within Twisted Python? My understanding is that gRPC is built using Futures and creates its own threads for all its event handling. There is also a gRPC Python package (grpcio 1.0.0) that is available for python 2.7. In order to use gRPC with Twisted Python in 2.7 is the only way to have gRPC run in its own thread?

Thanks
Khen
Glyph Lefkowitz
2016-09-28 18:15:19 UTC
Permalink
Post by Nursimulu, Khen
Is there a plan (or an implementation) to support gRPC within Twisted Python? My understanding is that gRPC is built using Futures and creates its own threads for all its event handling. There is also a gRPC Python package (grpcio 1.0.0) that is available for python 2.7. In order to use gRPC with Twisted Python in 2.7 is the only way to have gRPC run in its own thread?
There's no plan that I'm aware of. You could definitely run gRPC in a thread currently, although it would be nice if grpc worked natively with Twisted.

Probably contributing this upstream into the gRPC project would be the best way to start, and if they're not receptive, starting a separate 'txgRPC' project.

-glyph
Nursimulu, Khen
2016-09-28 19:13:26 UTC
Permalink
Thanks Glyth for the prompt response.

From: <twisted-python-***@twistedmatrix.com> on behalf of Glyph Lefkowitz <***@twistedmatrix.com>
Reply-To: "twisted-***@twistedmatrix.com" <twisted-***@twistedmatrix.com>
Date: Wednesday, September 28, 2016 at 2:15 PM
To: "twisted-***@twistedmatrix.com" <twisted-***@twistedmatrix.com>
Subject: Re: [Twisted-Python] gRPC support in Twisted Python


On Sep 28, 2016, at 6:13 AM, Nursimulu, Khen <***@ciena.com<mailto:***@ciena.com>> wrote:


Is there a plan (or an implementation) to support gRPC within Twisted Python? My understanding is that gRPC is built using Futures and creates its own threads for all its event handling. There is also a gRPC Python package (grpcio 1.0.0) that is available for python 2.7. In order to use gRPC with Twisted Python in 2.7 is the only way to have gRPC run in its own thread?

There's no plan that I'm aware of. You could definitely run gRPC in a thread currently, although it would be nice if grpc worked natively with Twisted.

Probably contributing this upstream into the gRPC project would be the best way to start, and if they're not receptive, starting a separate 'txgRPC' project.

-glyph
Werner Thie
2016-09-28 19:43:13 UTC
Permalink
Post by Nursimulu, Khen
Thanks Glyth for the prompt response.
Is there a plan (or an implementation) to support gRPC within
Twisted Python? My understanding is that gRPC is built using
Futures and creates its own threads for all its event handling.
There is also a gRPC Python package (grpcio 1.0.0) that is available
for python 2.7. In order to use gRPC with Twisted Python in 2.7
is the only way to have gRPC run in its own thread?
There's no plan that I'm aware of. You could definitely run gRPC in a
thread currently, although it would be nice if grpc worked natively with
Twisted.
Probably contributing this upstream into the gRPC project would be the
best way to start, and if they're not receptive, starting a separate
'txgRPC' project.
Interesting, with the browser implementation in the works this could
become a full replacement of nevow/athena

Werner
Stephen Thorne
2016-09-29 07:34:40 UTC
Permalink
[+Nathaniel]

https://groups.google.com/forum/m/#!topic/grpc-io/RpkyqqQy8TU/discussion

Hi. I'd like to link you to the above discussion and cc it's original
poster.
Post by Werner Thie
Post by Nursimulu, Khen
Thanks Glyth for the prompt response.
Is there a plan (or an implementation) to support gRPC within
Twisted Python? My understanding is that gRPC is built using
Futures and creates its own threads for all its event handling.
There is also a gRPC Python package (grpcio 1.0.0) that is available
for python 2.7. In order to use gRPC with Twisted Python in 2.7
is the only way to have gRPC run in its own thread?
There's no plan that I'm aware of. You could definitely run gRPC in a
thread currently, although it would be nice if grpc worked natively with
Twisted.
Probably contributing this upstream into the gRPC project would be the
best way to start, and if they're not receptive, starting a separate
'txgRPC' project.
Interesting, with the browser implementation in the works this could
become a full replacement of nevow/athena
Werner
_______________________________________________
Twisted-Python mailing list
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
James Broadhead
2016-09-30 00:41:14 UTC
Permalink
If you're planning on working on this, it'd probably be worth taking a look
at the Twisted bindings for Thrift (a competing RPC system from FB, based
on the Google PB paper).

The generator[2] isn't the best place to start (imperative C++ that outputs
python), but the code that it generates served us very well for years
(generally, communicating twisted->cassandra, or twisted->scala services).

[1] https://thrift.apache.org/
[2]
https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_py_generator.cc
Post by Stephen Thorne
[+Nathaniel]
https://groups.google.com/forum/m/#!topic/grpc-io/RpkyqqQy8TU/discussion
Hi. I'd like to link you to the above discussion and cc it's original
poster.
Post by Werner Thie
Post by Nursimulu, Khen
Thanks Glyth for the prompt response.
Is there a plan (or an implementation) to support gRPC within
Twisted Python? My understanding is that gRPC is built using
Futures and creates its own threads for all its event handling.
There is also a gRPC Python package (grpcio 1.0.0) that is available
for python 2.7. In order to use gRPC with Twisted Python in 2.7
is the only way to have gRPC run in its own thread?
There's no plan that I'm aware of. You could definitely run gRPC in a
thread currently, although it would be nice if grpc worked natively with
Twisted.
Probably contributing this upstream into the gRPC project would be the
best way to start, and if they're not receptive, starting a separate
'txgRPC' project.
Interesting, with the browser implementation in the works this could
become a full replacement of nevow/athena
Werner
_______________________________________________
Twisted-Python mailing list
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________
Twisted-Python mailing list
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Nathaniel Manista
2016-10-06 18:49:51 UTC
Permalink
Post by James Broadhead
If you're planning on working on this,
We don't currently have plans to implement it ourselves; we're trying to
invoke the magic of open source. So far the feature requests we've gotten
have been all over the map (gevent <http://www.gevent.org/>/asyncio
<https://docs.python.org/3/whatsnew/3.4.html#asyncio>/async-await
<https://docs.python.org/3/whatsnew/3.5.html#pep-492-coroutines-with-async-and-await-syntax>)
that what's most important right now is just fostering the conversation
among everyone who is interested about what the desired behavior of gRPC
Python will be.

it'd probably be worth taking a look at the Twisted bindings for Thrift (a
Post by James Broadhead
competing RPC system from FB, based on the Google PB paper).
The generator[2] isn't the best place to start (imperative C++ that
outputs python), but the code that it generates served us very well for
years (generally, communicating twisted->cassandra, or twisted->scala
services).
[1] https://thrift.apache.org/
[2] https://github.com/apache/thrift/blob/master/compiler/
cpp/src/thrift/generate/t_py_generator.cc
Please contribute this to the thread
<https://groups.google.com/d/topic/grpc-io/RpkyqqQy8TU/discussion>/design
document
<https://github.com/grpc/grpc-experiments/blob/master/python/async/README.md>
/conversation.
-Nathaniel
Manish Tomar
2016-10-06 19:11:22 UTC
Permalink
Post by Nathaniel Manista
Post by James Broadhead
If you're planning on working on this,
We don't currently have plans to implement it ourselves; we're trying to
invoke the magic of open source. So far the feature requests we've gotten
have been all over the map (gevent/asyncio/async-await) that what's most
important right now is just fostering the conversation among everyone who is
interested about what the desired behavior of gRPC Python will be.
It will be nice if it can be implemented without IO [1] as Cory
rightfully points out everywhere.
Post by Nathaniel Manista
Post by James Broadhead
it'd probably be worth taking a look at the Twisted bindings for Thrift (a
competing RPC system from FB, based on the Google PB paper).
The generator[2] isn't the best place to start (imperative C++ that
outputs python), but the code that it generates served us very well for
years (generally, communicating twisted->cassandra, or twisted->scala
services).
[1] https://thrift.apache.org/
[2]
https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_py_generator.cc
Please contribute this to the thread/design document/conversation.
Thanks! I'll probably try to mention about sans-IO part there.
Post by Nathaniel Manista
-Nathaniel
_______________________________________________
Twisted-Python mailing list
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
[1] https://sans-io.readthedocs.io/
Nathaniel Manista
2016-10-06 23:22:59 UTC
Permalink
Post by Manish Tomar
It will be nice if it can be implemented without IO [1] as Cory
rightfully points out everywhere.
I'm a big fan of sans I/O; I think it will be interesting to see how much
it can be applied to the C-language library that implements most of the
behavior of gRPC Python.
-N
Cory Benfield
2016-10-12 16:25:37 UTC
Permalink
On this note, if anyone wanted to write a greenfield gRPC implementation for Twisted directly, rather than using the C++ library that Nathaniel has been working on, hyper-h2 and Twisted’s built-in HTTP/2 logic is likely to be a very useful leaping off point. My high-level understanding of gRPC is that at a wire-protocol level the other things required are some protocol buffers and some code generation. That’s definitely not *nothing*, but neither is it the same as implementing the whole thing in one go.

Cory
Post by Manish Tomar
It will be nice if it can be implemented without IO [1] as Cory
rightfully points out everywhere.
I'm a big fan of sans I/O; I think it will be interesting to see how much it can be applied to the C-language library that implements most of the behavior of gRPC Python.
-N
_______________________________________________
Twisted-Python mailing list
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Loading...