Refactor dispatch method of ResponseDispatcher to be unchecked #223

Merged
lars.winzer merged 5 commits from feat/35-make-dispatch-method-of-responsedispatcher-unchecked into main 2026-04-01 13:04:14 +02:00
Showing only changes of commit 4deeace547 - Show all commits
@@ -30,9 +30,14 @@ public class ResponseDispatcher {
* @throws InterruptedException if the thread is interrupted while waiting to enqueue the
* primitive response
*/
public void dispatch(Response response) throws InterruptedException {
public void dispatch(Response response) {
PrimitiveResponse primitiveResponse = ResponseEncoder.encode(response);
Session session = sessionManager.getSessionById(response.getSessionId());
session.getResponseQueue().put(primitiveResponse);
try {
session.getResponseQueue().put(primitiveResponse);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ResponseDispatchException("Interrupted while dispatching response", e);
}
}
}