phaistos-networks / TANK

A very high performance distributed log service
Apache License 2.0
938 stars 70 forks source link

consume response / streaming semantics #1

Open markpapadakis opened 8 years ago

markpapadakis commented 8 years ago

For consume responses, where the returned response size is too high, instead of ingesting the whole response into the buffer, we can instead parse bundles as they arrive using a simple state machine. That way, we can e.g reuse the input buffer if we reach its end, or at least trim it so that we won't need much memory to process the response. It will mean that we 'll get to provide the client(callee) with bundles/messages faster.

This shouldn't be hard to implement.

markpapadakis commented 7 years ago

A new partition_content::respComplete field has been added, and clients should consider it. If it's false, it means we are provided a message set for the specific response to the client, but the response is not complete and more messages for that request's response will follow.

markpapadakis commented 7 years ago

A new TankClient::set_allow_streaming_consume_responses() can be used now(although because this is not implemented yet, it won't affect the response delivery semantics)

markpapadakis commented 4 years ago

This has been implemented in TANK2(i.e, the current release), but it turned out it didn't work as expected as I wanted, so its not used by default. See client_api_fast_consume.cpp