Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

v5.3.7

Choose a tag to compare

@blittle blittle released this 21 Jun 19:21
· 13 commits to master since this release

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();
});