This repository was archived by the owner on Apr 15, 2025. It is now read-only.
v5.3.7
Remove automatic timeout error handling. Instead this should be implemented with middleware.
#11
This should now be implemented with middleware:
let requestMap = {};
rxws.requestUse().subscribe(({req, send, next, reply}) => {
const correlationId = req.header.correlationId;
if (requestMap[correlationId]) clearTimeout(requestMap[correlationId]);
requestMap[correlationId] = setTimeout(() => {
console.error(`No response after 10 seconds for resource ${req.header.resource}`);
}, 10000);
next();
});
rexws.use().subscribe(({res, reply, retry, next}) => {
const correlationId = res.header.correlationId;
clearTimeout(requestMap[correlationId]);
delete requestMap[correlationId];
next();
});