Refactor: dispatch method of ResponseDispatcher is now unchecked and throws ResponseDispatchException

This commit is contained in:
Lars Simon Winzer
2026-04-01 12:46:14 +02:00
parent 68e8bc76b2
commit 4deeace547
@@ -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());
try {
session.getResponseQueue().put(primitiveResponse);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ResponseDispatchException("Interrupted while dispatching response", e);
}
}
}