thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aditya Sarawgi <adityasarawgi...@gmail.com>
Subject Re: Thrift optional type for rpc response
Date Thu, 21 Nov 2013 22:05:08 GMT
Should I update the exisitng tutorial or write a new one ?


On Thu, Nov 21, 2013 at 1:56 PM, Jens Geyer <jensgeyer@hotmail.com> wrote:

> Hi Aditya,
>
> I wonder if it would be possible for you to prepare a patch to update the
> tutorial sources accordingly? You don't have to, I'm just asking.
>
> http://thrift.apache.org/docs/HowToContribute/
>
> Have fun,
> Jens
>
>
>
> -----Urspr├╝ngliche Nachricht----- From: Aditya Sarawgi
> Sent: Thursday, November 21, 2013 10:50 PM
> To: user@thrift.apache.org
> Subject: Re: Thrift optional type for rpc response
>
>
> Hey Henrique,
>
> That is exactly what I wanted to know. Thanks !
>
> --
> Aditya Sarawgi
>
>
> On Wed, Nov 20, 2013 at 3:19 PM, Henrique Mendon├ža <henrique@apache.org
> >wrote:
>
>  Hi Aditya,
>>
>> That's how the cpp lib works with optionals. You either need to use the
>> setter or do __isset.msgs = true yourself.
>> Unfortunately this is not in the tutorial yet...
>> I hope it helped.
>>
>> Best,
>> Henrique
>>
>>
>> On 20 November 2013 23:08, Aditya Sarawgi <adityasarawgioo7@gmail.com
>> >wrote:
>>
>> > The language is cpp.
>> >
>> >
>> > On Wed, Nov 20, 2013 at 12:53 AM, Aditya Sarawgi <
>> > adityasarawgioo7@gmail.com
>> > > wrote:
>> >
>> > > Hi Everyone,
>> > >
>> > > I have some questions about the way I am using thrift optional types
>> > > or
>> > > rather I am not sure if this is the right way to use it. The thrift
>> file
>> > > looks something like this
>> > >
>> > > namespace something
>> > >
>> > > struct Response {
>> > >  1: Status status,
>> > >  2: optional list<string> msgs
>> > >
>> > > }
>> > >
>> > > service Something {
>> > >   Respone getMessages(1: i16 id)
>> > > }
>> > >
>> > > Now first of all I am confused by the following
>> > >
>> > > 1) Should optional be ever used in a response
>> > > 2) If doesn't return the msgs until I do a
>> > > _return.__set_msgs(vector_of_msgs) which looks hacky to me.
>> > >
>> > > Any guidance on this is much appreciated, the documentation is really
>> > > sparse.
>> > >
>> > > Thanks
>> > > Aditya Sarawgi
>> > >
>> >
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message