You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by EY Tsai <ey...@comcast.net> on 2010/08/16 22:57:27 UTC

Is it possible to return service from a service function.

Hi,

I'm new to Thrift. Is it possible. Or any way around? Something like below

struct Item {
   1: string key,
   2: string value
}

service Store {
    Item get(1: string key),
    Item save(1: string key, 2: Item e),
}

service StoreManager {
    Store getStore(1: String storeName),
    Store createStore(1: String storeName)
}


Thanks.

Re: Is it possible to return service from a service function.

Posted by Bryan Duxbury <br...@rapleaf.com>.
Sadly, no, service methods cannot return service instances.

On Mon, Aug 16, 2010 at 1:57 PM, EY Tsai <ey...@comcast.net> wrote:

> Hi,
>
> I'm new to Thrift. Is it possible. Or any way around? Something like below
>
> struct Item {
>  1: string key,
>  2: string value
> }
>
> service Store {
>   Item get(1: string key),
>   Item save(1: string key, 2: Item e),
> }
>
> service StoreManager {
>   Store getStore(1: String storeName),
>   Store createStore(1: String storeName)
> }
>
>
> Thanks.
>