You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__Problem__
`PayloadImpl` caches `data` and `metadata` buffers. This means once those buffers are read, they can not be reused as the pointer of `ByteBuffer` has moved to the end of buffer.
This restricts the usage of `PayloadImpl` instance with something like:
```java
socket.requestResponse(new PayloadImpl("Hello")).retry(2);
```
For any retry in the above code, data read from the payload instance will be empty.
__Modification__
- store buffer `position()` on creation and reset them on every `get()`.
- Additional constructor to override this behavior and create a payload for single use.
- `PayloadImpl` defaults to reusable payload.
__Result__
Possible to retry a request without having a custom `Payload` implementation.
0 commit comments