specification icon indicating copy to clipboard operation
specification copied to clipboard

consider streaming fetch for real time updates

Open elf-pavlik opened this issue 5 years ago • 3 comments

https://treecg.github.io/specification/#imports

A tree:importStream can also be defined for providing a pubsub interface for subscribing to real-time updates. The object SHOULD be a [websockets] or Server-Sent Events ([eventsource]).

Given that Fetch supports streaming body, websockets and server-sent events might not be necessary. It could have advantage, for example in situation when Authorization needs to be set.

elf-pavlik avatar Jan 22 '21 19:01 elf-pavlik

@elf-pavlik Thanks for the issue! Really appreciate your eyes on this spec!

Streaming body: would that entail long polling then? Last time I checked, long polling had serious performance issues compared to SSE and WebSockets, right? With Server-Sent Events, you can also set the Authorization header, no?

pietercolpaert avatar Feb 09 '21 16:02 pietercolpaert

With Server-Sent Events, you can also set the Authorization header, no?

AFAIK SSE doesn't allow setting headers related discussion https://github.com/solid/specification/issues/122#issuecomment-598270495

Streaming body: would that entail long polling then?

I mean relying on relatively new ReadableStream.getReader() on the body of fetch response (example snippet in discussion linked above).

Google Chrome Developers has a friendly video on Streaming requests with fetch (HTTP 203 series)

elf-pavlik avatar Feb 18 '21 20:02 elf-pavlik

We will look into this and get back to you!

Also happy to hear your thoughts @brechtvdv @julianrojas87

pietercolpaert avatar Mar 01 '21 18:03 pietercolpaert

Imports are now gone from the main spec. Making the connection to a push-based system should be handled in the LDES specification that also specifies how the collection can change.

pietercolpaert avatar Oct 09 '24 07:10 pietercolpaert