TREEcg / specification

RDF vocabulary and hypermedia specification to publish your Linked Data using search trees
https://w3id.org/tree/specification
29 stars 13 forks source link

consider streaming fetch for real time updates #27

Closed elf-pavlik closed 1 month ago

elf-pavlik commented 3 years ago

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.

pietercolpaert commented 3 years ago

@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?

elf-pavlik commented 3 years ago

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)

pietercolpaert commented 3 years ago

We will look into this and get back to you!

Also happy to hear your thoughts @brechtvdv @julianrojas87

pietercolpaert commented 1 month ago

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.