View Source kpro_sent_reqs (kafka_protocol v4.1.10)

This module manages an opaque collection of sent-requests.

Summary

Functions

Add a new request to sent collection. Return the last corrlation ID and the new collection.
Delete a request from the opaque collection. Crash if correlation ID is not found.
Get the correction to be sent for the next request.
Get caller of a request having the given correlation ID. Crash if the request is not found.
Fetch and increment the correlation ID This is used if we don't want a response from the broker
Scan all sent requests to get oldest sent request. Age is in milli-seconds. 0 is returned if there is no pending response.

Types

-type corr_id() :: kpro:corr_id().
-opaque requests()

Functions

Link to this function

add(Requests, Caller, Ref, API, Vsn)

View Source
-spec add(requests(), pid(), reference(), kpro:api(), kpro:vsn()) -> {corr_id(), requests()}.
Add a new request to sent collection. Return the last corrlation ID and the new collection.
-spec del(requests(), corr_id()) -> requests().
Delete a request from the opaque collection. Crash if correlation ID is not found.
-spec get_corr_id(requests()) -> corr_id().
Get the correction to be sent for the next request.
Link to this function

get_req(Requests, CorrId)

View Source
-spec get_req(requests(), corr_id()) -> {pid(), reference(), kpro:api(), kpro:vsn()}.
Get caller of a request having the given correlation ID. Crash if the request is not found.
Link to this function

increment_corr_id(Requests)

View Source
-spec increment_corr_id(requests()) -> {corr_id(), requests()}.
Fetch and increment the correlation ID This is used if we don't want a response from the broker
-spec is_empty(requests()) -> boolean().
-spec new() -> requests().
Link to this function

scan_for_max_age(Requests)

View Source
-spec scan_for_max_age(requests()) -> timeout().
Scan all sent requests to get oldest sent request. Age is in milli-seconds. 0 is returned if there is no pending response.