Helpers for synchronous callers that need to wait on Tokio cold-read NIFs.
The NIF sends {:tokio_complete, corr_id, ...} to the pid passed at submit
time. If a caller waits directly and times out, a late completion can remain
in that caller's mailbox. These helpers submit through a short-lived proxy
process, so late completions are consumed or dropped away from the caller.
Summary
Types
@type submit_fun() :: (pid(), pos_integer() -> :ok | {:error, term()})
Functions
@spec pread_at(binary(), non_neg_integer(), timeout()) :: result()
@spec pread_at(binary(), non_neg_integer(), binary(), timeout()) :: result()
@spec pread_batch([{binary(), non_neg_integer()}], timeout()) :: result()
@spec pread_batch_keyed([{binary(), non_neg_integer(), binary()}], timeout()) :: result()
@spec pread_keyed(binary(), non_neg_integer(), binary(), timeout()) :: result()