httpyac
httpyac copied to clipboard
No hook for SSE events
I thought the {{@streaming construct might work as a hook for the SSE events but apparently it doesn't. I guess from looking into the code that SSE does not have a concept of progress which is see is a condition to adding the interceptor. Any plans for how to achieve this for SSE events?
the streaming hook is basically there to tell the RequestClient how long the connection will take. If you want to react directly to the messages, you can still attach yourself to the message event. But that depends on the use case you want to achieve.
SSE https://sse.dev/test
Event: message
{{@streaming
$requestClient.addEventListener("message", (response) => console.info("hook"));
async function writeStream(){
await sleep(10000);
}
exports.waitPromise = writeStream();
}}