andygrundman/thrift-xs

Thrift::XS::BinaryProtocol only works with Thrift::XS::MemoryBuffer as transport

Opened this issue · 2 comments

First - thanks for writing an Thrift::XS package - Perl can really use it.

I am trying it out and found this. Any calls to the write* methods of Thrift::XS::BinaryProtocol do not correctly call the underlying transport write() method, it dies with the message:

Can't call method "write" on an undefined value

Thanks, hmm, I thought this worked. Really you don't want to use any other transport anyway because of how inefficient it is (lots of 1-byte read/write calls). I'll see about adding a test for this though.

I'm using a Thrift::XS::MemoryBuffer inside my own Transport class, but as I am also not using this in an event loop I have no way of checking if the buffer is full and flushing it to the socket unless I wrap around it and check at write time. We also call flush and that gets passed through directly to the underlying transport and as MemoryBuffer doesn't support flush it dies as well.

Thanks for the quick response!

-chris

On Aug 2, 2011, at 2:18 PM, andygrundman wrote:

Thanks, hmm, I thought this worked. Really you don't want to use any other transport anyway because of how inefficient it is (lots of 1-byte read/write calls). I'll see about adding a test for this though.

Reply to this email directly or view it on GitHub:
#1 (comment)