Some protocols, so far only kafka, have some requests which do not trigger a response.
This is forbidden by our transform invariants, so to handle this we have logic in SinkConnection to insert dummy responses that correspond to those requests.
This works but I've done some thinking and I am proposing that we throw this away and instead have the user just call the new respondable_id() method when they need to wait for a response on a protocol which may not send a response:
It should be a performance improvement for cases with many responseless requests, for example a kafka client configured with acks = 0:
In SinkConnection, avoids bookkeeping vec allocations, message vec insertions.
In certain transforms, responseless requests do not need to have their ID's inserted and removed from hashmaps to correlate to a response that is in reality only a dummy response to be ignored.
We are swapping around complexity, hard to say which is better.
Previously, transforms for certain protocols need to handle the possibility of some responses containing Dummy frames instead of the frame of the protocol.
With this PR, transforms for certain protocols need to call respondable_id() instead of id() when correlating responses to requests, currently none of our transforms actually need to do this.
Some protocols, so far only kafka, have some requests which do not trigger a response. This is forbidden by our transform invariants, so to handle this we have logic in SinkConnection to insert dummy responses that correspond to those requests. This works but I've done some thinking and I am proposing that we throw this away and instead have the user just call the new
respondable_id()
method when they need to wait for a response on a protocol which may not send a response:acks = 0
:respondable_id()
instead ofid()
when correlating responses to requests, currently none of our transforms actually need to do this.