RPC Design Structure

2008-11-19 Thread codeazure
I've been struggling to work out how to use PB's RPC mechanism within my application. I don't have a problem with the simple usage of it or the transport side. It's more how I would scale it up within a larger modular application. My application can run on multiple machines that need to talk to

Custom EnumValueOptions?

2008-11-19 Thread Jerry Cattell
I'm trying to use a custom EnumValueOption: package test; import google/protobuf/descriptor.proto; extend google.protobuf.EnumValueOptions { optional string code = 1234; } enum ProductType { ROCK = 0 [(code) = R]; PAPER = 1 [(code) = P]; SCISSORS = 2 [(code) = S]; } However, this

Re: Custom EnumValueOptions?

2008-11-19 Thread Kenton Varda
Good news: There was a patch for this submitted to the internal version of the code which should make its way to SVN today or tomorrow, and will be in the 2.0.3 release. On Wed, Nov 19, 2008 at 1:29 AM, Jerry Cattell [EMAIL PROTECTED]wrote: I'm trying to use a custom EnumValueOption:

Re: RPC Design Structure

2008-11-19 Thread Kenton Varda
I'm not sure I understand. There's nothing stopping you from spreading your definitions out among multiple .proto files which import each other, and there's nothing stopping you from exporting multiple services from a single server. You'll need to design a protocol that allows it, but protocol

Re: RPC Design Structure

2008-11-19 Thread codeazure
On Nov 20, 7:58 am, Kenton Varda [EMAIL PROTECTED] wrote: I'm not sure I understand.  There's nothing stopping you from spreading your definitions out among multiple .proto files which import each other, and there's nothing stopping you from exporting multiple services from a single server.  

Re: RPC Design Structure

2008-11-19 Thread Kenton Varda
RpcController objects are per-request, not per-server or per-service. For every RPC request you make, you should have another RpcController object (though you can reuse an object by calling Clear() as long as you aren't making two requests at once). RpcChannel objects are per-service. Is that

Re: RPC Design Structure

2008-11-19 Thread codeazure
OK, now you've confused me :-) I don't understand the exact relationship between all these classes, which is why I'm asking the question. If I want to build an application where I have a number of services that share a single TCP port, what organisation do I need to use? You mention

Re: RPC Design Structure

2008-11-19 Thread Kenton Varda
The design of an RPC system is a large topic and there are lots of different ways you could do it. The RPC interfaces provided by Protocol Buffers are meant to provide the minimum support necessary to allow protoc to generate type-safe service stubs. How you want to implement them is up to you.

Re: RPC Design Structure

2008-11-19 Thread Shane Green
Thanks for the breakdown, that's very helpful. I had some trouble finding details about how the PB RPC terminology mapped to what I'm familiar with. It sounds like the system in question has a single public service with delegates calls to back-end services, distributed across machines available

Re: Makefile rules

2008-11-19 Thread James Bruce
On Mon, Nov 17, 2008 at 17:02, codeazure [EMAIL PROTECTED] wrote: Has anyone devised a makefile rule for the .protoc-.cc-.o sequence? ... This appears to work well, but I was hoping it is possible to define a .proto.cc rule to automate it by some cleverness. My project uses Automake it is