Closed arthur-fontaine closed 1 month ago
https://github.com/arthur-fontaine/agrume/pull/94#issuecomment-2323103074
Neither XHR nor Fetch API allows to achieve a full-duplex communication. Fetch API simply does not allow duplex: "full"
in the majority of runtimes (only Deno does), while XHR does not allow to send ReadableStream as body.
We need to either:
${routePath}/__agrume_write
route that will allow to send body as stream with Fetch API, while streaming response of ${routePath}
. If we do that, how do we match requests together? With a header provided by the client that provide a "request ID"? x-agrume-rid
? It should necessary be a "complex" id (crypto.randomUUID()
?)
To complete the realtime capability, we should be able to receive streams.