I've seen a fair amount of messages regarding streaming and
self-describing messages.  I haven't reviewed them very closely, so I
apologize if this is redundant, but could an envelop wrapper design
satisfy the needs?  Something to the effect of:

message Envelope {
    required int64 type = 1;
    optional bytes message = 2;
}

Messages sent on the wire could always serialized Envelope messages.
Each Envelope's payload could then be the serialized representation of
the message whose type it specifies.






On Sun, 2008-11-30 at 13:28 +0000, Stuart Johnson wrote:
> I would like an efficient way of describing which message is being sent in a 
> stream. Using a string name (as used in Protobuf rpc), is less efficient than 
> a numeric value.
> 
> All fields have a unique numeric key, so how about messages also having a 
> (optional) numeric key also?  Then the PB compiler could populate a global 
> enumerator list of messages.
> 
> 
> 
> message someFoo <1>
> {
>     required    int64 _fooData    = 1;
> }
> 
> 
> message moreFoo <2>
> {
>     required    int64 _fooData    = 1;
> }
> 
> 
> enum MessageType     #Autogenerated by PB compiler
> {
>     someFoo = 1;
>     moreFoo = 2;
> }
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to