It'd be cool if one could open an EventSource on an OrderedCollection to subscribe for changes in a user's outbox, This could be used as a basis for real time chats and games.
Probably needs to be on top of HTTP2/3 to handle more subscriptions over a single connection.
Maybe even with a Triple Pattern Fragments querystring to filter by Activity type/author/cc/etc?
@evan Ah but that is for servers to get data pushed to other accounts' server inboxes not for clients to pull updates from a server.
E.g. a client application would need extra apis specific to their sever to be able to get updates.
I'm into thick clients over implementation specific server APIs. 😅
@mauve oh, right. So, what about Websockets?
@evan Websockets means inventing more wire protocols and is much harder to implement. Server Sent Events are a simple text based standard and have a way to deliniate event types / reconnect logic / etc. Fitting an event stream of AP Activities is a small amount of spec work and implimentation compared to websockets. (cross language too) Also easy browser APIs!
@mauve Cool. I'd implement that.
@evan @mauve I don't really know much about AP, but maybe you could use ReadableStream API?
I was tinkering with SSE, but then came across this via a toot (that itself I can't find): https://github.com/Azure-Samples/chatgpt-quickstart/pull/19/files
@daaain Could you elaborate now how the ReadableStream API applies to this context? Do you mean that folks should parse `fetch()` responses as a binary buffer stream and that that would be used for subscriptions along with a custom NDJSON based wire protocol instead of the EventSource API?
IMO EventSource give us more to work with, but I would agree that NDJSON with a series of Activities would be easy to implement.
@daaain No, I think you're spot on with the ndjson stuff. I'm just too web browser brained with this niche api that barely anyone uses. :P opening a request and piping it into an ndjson parser might need a bit more work dependency wise or code wise, but it's also more likely to have easier implementations accross languages. 😅