tigerbeetle icon indicating copy to clipboard operation
tigerbeetle copied to clipboard

Rework `tb_client` packet memory management.

Open kprotty opened this issue 7 months ago • 3 comments

Currently, a tb_client user requests how many packets they want when creating a client instance. To submit a request, the user acquires a packet from the client and releases it when the request completes. Given there's a limit on inflight packets, acquire_packet() can fail which now introduces a synchronous failure path (packet errors are reported asynchronously after submit()).

Proposing an idea where the client leaves packet allocation to the user and submit() takes in packets intrusively / from any memory allocation. This allows the client user to allocate the packet along with any request data, control packet concurrency limits more flexibly, and move all client error handling to the on_complete(packet, ...) callback.

kprotty avatar Oct 16 '23 05:10 kprotty