I would like to consume a stream in a thrift service, for example, in a service method to have a stream or something similar as an argument to the method (for example, to be
Apache thrift does not support sending streams. The closest you can get, is send a byte array.
To achieve stream-like experience using thrift, you can create an interface that returns the next part of the stream in a form of byte array.
In C# syntax it would look like
interface MyService
{
int OpenStream(string path);
byte[] ReadNextBlock(int openedStreamId, long maxBlockSize);
}
OpenStream returns "stream id" that is passed to ReadNextBlock on each call. On your server-side you may hold a Dictionary(key - openStreamID, value - Stream) that will be used to keep the source stream open and read next blocks from it.
You can also create a helper class on client side that will be Stream descendant and will use OpenStream and ReadNextBlock to get the actual data.