Use a TMemoryBuffer as the transport, then grab the contents of the buffer. See checkWrite in test/FastbinaryTest.py
Joshua Kramer wrote: > Is there a quick way to serialize an object to a string or blob? > > Thanks! > -Josh > > On Sat, 6 Jun 2009, David Reiss wrote: > >> Date: Sat, 6 Jun 2009 20:37:43 -0700 >> From: David Reiss <[email protected]> >> Reply-To: [email protected] >> To: "[email protected]" <[email protected]> >> Subject: Re: Non-standard transports >> >> I'm not sure I understand your exact use case, but it is fairly easy >> in Thrift to swap out the standard transport implementations for your >> own. It sounds like your use case is fairly similar to the THttpClient, >> which is a TTransport that sends messages as http requests. >> >> --David >> >> Joshua Kramer wrote: >>> Hello, >>> >>> Is there any support, in either Python or C++, for servers with >>> non-standard transports? >>> >>> For example, suppose I have a message. I would like to call some method >>> on the message that would automatically determine its Operation, >>> dispatch the method call, and give me a message with the return value. >>> >>> I am using the Apache QPid for all of my messages. Currently I am using >>> Google Protocol Buffers to do calls between Python clients and servers >>> via Apache QPid. My server daemon receives a message, deserializes it >>> via PB, dispatches to the correct method, and re-serializes the return >>> object to send back to the QPid server. The exception handling and >>> dispatch provided by Thrift is appealing... >>> >>> Cheers, >>> -JK >
