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?

@mauve what?!?!

You can subscribe to changes to the outbox by following the actor.

That's 90% of AP!

@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. 😅

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

@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): github.com/Azure-Samples/chatg

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

@mauve I must admit I'm a bit out of my depth in the context of this thread, but just spotted SSE and remembered the thread where Pamela was explaining how much simpler the implementation was after this change, but it might be totally inappropriate for what you're trying to do, in which case apologies 😅

Follow

@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. 😅

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.