[C2S] Add Server-Sent Events (SSE) for real-time collection streaming#2945
Draft
pfefferle wants to merge 1 commit intoadd/c2s-supportfrom
Draft
[C2S] Add Server-Sent Events (SSE) for real-time collection streaming#2945pfefferle wants to merge 1 commit intoadd/c2s-supportfrom
pfefferle wants to merge 1 commit intoadd/c2s-supportfrom
Conversation
Implement the SWICG ActivityPub API SSE spec so C2S clients can subscribe to live updates on outbox and inbox collections instead of polling. - Add Event_Stream_Controller with SSE stream endpoint per collection - Add Event_Stream signal class using transients for efficient polling - Add access_token query parameter fallback for EventSource clients - Add eventStream property to outbox and inbox collection responses - Add proxyEventStream to actor endpoints (proxy returns 501 for now)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the SWICG ActivityPub API SSE spec so C2S clients can subscribe to live updates on outbox and inbox collections instead of polling.
Proposed changes:
Event_Stream_Controllerwith SSE stream endpoint (GET /actors/{id}/{collection}/stream) that requirespushOAuth scopeEvent_Streamsignal class using transients to efficiently notify the SSE polling loop of new itemsaccess_tokenquery parameter fallback in OAuth Server for EventSource clients (which cannot send Authorization headers)eventStreamproperty to outbox and inbox collection responsesproxyEventStreamto actorendpoints(proxy endpoint returns 501 for now —wp_remote_getdoes not support streaming)Other information:
Testing instructions:
proxyEventStreaminendpoints:eventStreamproperty:pushscope, then test the SSE stream:text/event-streamheaders and keepalive comments every 5 secondsAddevent with the activity JSONChangelog entry
Changelog Entry Details
Significance
Type
Message
Add real-time event streaming for connected apps using Server-Sent Events.