Classification: UNCLASSIFIED
Caveats: FOUO

Good question on the C++ APIs... Seems like I also only see C++ generated code 
for writing the service implementation but not connecting to one.

-----Original Message-----
From: Amir Taaki [mailto:[email protected]] 
Sent: Friday, November 30, 2012 12:30 PM
To: [email protected]
Subject: Yielding service handler methods in C++

Hey,

I'd like to have my service handler make an async request and then return the 
result once it's ready.

Currently you have something like:

int32_t add(const int32_t n1, const int32_t n2) {
    int32_t result = do_something(n1, n2);

    return result;

}

I want to be able to do something like:

void add(Result& result, const int32_t n1, const int32_t n2) {
    // function call returns immediately

    do_something(result, n1, n2);
}

The operation 'add' is added to a stack, and then a worker thread picks it up, 
computes the result and finally gives it back to thrift so it can be sent to 
the client.

Otherwise I'd have to use futures and promises which isn't the best solution if 
thrift supports async natively.

BTW are there any libthrift C++ packages. I saw only Java and Python bindings 
so I was confused why the core library is missing.


Classification: UNCLASSIFIED
Caveats: FOUO


Reply via email to