What do you think of the idea of defining the RPC protocol in a
".proto" file ?
And have each (protobuf) message prefixed by length, in wire protocol:
Thus one can use already existing Protocol like NetString, or
Int32StringPrefixed, for reading message one by one, and decode the
message using protobuf to dispatch the call (or the answer).
On Fri, Jul 18, 2008 at 5:17 PM, Johan Euphrosine <pro...@aminche.com> wrote:
> Sure, I'll take a look for implementing it next week,
>
> I'll be looking forward using the same 'format codes' you did,
> instead of doing some protobuf nesting I don't feel very confortable with:
> http://bazaar.launchpad.net/~proppy/txprotobuf/master/annotate/23?file_id=txprotobuf.proto-20080718121617-wa53tea90747nfwb-1
>
> On 7/18/08, Frederik M.J.V. <fre...@iskrembilen.com> wrote:
>> I am creating an rpc protocol using google protocol buffers, and i have made an
>> implementation for java. I see that you have made an implementation for python
>> and wondered if we could cooperate on the protocol to make the rpc
>> implementations work with eachother.
>>
>> I have documented the protocol i use at
>> http://iskrembilen.com/freqmod/web/Protorpcdoc.html , but are open for
>> suggetions and improvements. My java implementation is avaliable from
>> http://kdemod.iskrembilen.com/git/gitweb.cgi?p=freqmod/protorpc/.git;a=summary
>>
>> --
>>
>>
>> Frederik M.J.V
>>
>
>
> --
> bou ^
>
--
bou ^
You can clone it using bazaar:
bzr branch lp:txprotobuf
2008/7/21 [CPR]-AL.exe <CPR.A...@gmail.com>:
--
bou ^
I've begun implementation of your rpc protocol in a new branch:
http://bazaar.launchpad.net/~proppy/txprotobuf/freqmod/files
Tests are passing with theses modifications:
http://bazaar.launchpad.net/~proppy/txprotobuf/freqmod/revision/37
http://bazaar.launchpad.net/~proppy/txprotobuf/freqmod/revision/38
Note that for now it uses Int32 prefix, yours is using Int16 right ?
You can pull the code with:
bzr branch lp:~proppy/txprotobuf/freqmod
--
bou ^
> On Jul 25, 5:48 pm, "Johan Euphrosine" <pro...@aminche.com>
>
>> Note that for now it uses Int32 prefix, yours is using Int16 right ?
>
> Ok we can standardize on uint32 (little endian), i'll update my
> specification and code.
I'd like to verify: I think they're the same but its the "network"
encoding for 32 bit unsigned integer we're standardizing on. Java uses
that encoding natively. Python requires the "pack" prefix:
i=pack("!I",length)
don't know what C++ requires to disambiguate but I'm sure its in there.
>
> If you want to use my code and try to get it included in twisted i can
> make the _python_ version avaliable under the MIT license. ( just send
> me a mail/post a message and i will put it in the git repository )
I've been thinking a bit about all this. It seems to me that it wouldn't
be hard to go one step further and venture into true distributed objects.
I reference the twisted-related Foolscap project:
http://foolscap.lothar.com/trac
which is really the next version of twisted's PB architecture. Not
entirely sure of the history but I think the author got a job so the
projects are somewhat disjoint. but it seems clear that the intent is to
merge it all with twisted. (but I don't actually know)
I've been using Foolscap and its very solid. The notion of the Tub is
also very useful in terms of object management semantics and could be
"easily" (noting that nothing is easy) implemented in the "usual"
languages.
The one needed extension is the notion of a generalized object reference.
Host:port:object typically works fine and there's a url definition in
foolscap.
As one generalizes things get tricker: as you're all too aware. Defining
a few messages and services in protobuf might get us most of the way there
and hopefully avoid the generalized problem black hole. (i.e. the endless
threads on idempotency etc.)
-glenn
--
Glenn H. Tarbox, PhD || gl...@tarbox.org
"Don't worry about people stealing your ideas. If your ideas are any
good you'll have to ram them down peoples throats" -- Howard Aiken
> don't know what C++ requires to disambiguate but I'm sure its in there.
it is just bitshifting and bitwise or and and. (i am using it in java too)
> > If you want to use my code and try to get it included in twisted i can
> > make the _python_ version avaliable under the MIT license. ( just send
> > me a mail/post a message and i will put it in the git repository )
>
> I've been thinking a bit about all this. It seems to me that it wouldn't
> be hard to go one step further and venture into true distributed objects.
> I reference the twisted-related Foolscap project:
>
...
> As one generalizes things get tricker: as you're all too aware. Defining
> a few messages and services in protobuf might get us most of the way there
> and hopefully avoid the generalized problem black hole. (i.e. the endless
> threads on idempotency etc.)
>
The foolscap architecture looks interesting, but I want to make a simple
library (like protobuf is) with no external dependencies except protobuffers at
the core. The TwoWayBase shares the idea of having no server and client when
it comes to the protocol layer.
Then one could build more interresting things on top of that. Therefore i am
implementing sockets and a socket server without twisted too. (it's only
about 300 lines of code)
--
Frederik