feat: SSE broadcaster for agent events#435
Open
kentbull wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #435 +/- ##
==========================================
+ Coverage 87.71% 87.84% +0.13%
==========================================
Files 26 27 +1
Lines 5810 5900 +90
==========================================
+ Hits 5096 5183 +87
- Misses 714 717 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
See WebOfTrust/signifypy#145 for the SignifyPy client implementation of this. |
Collaborator
Author
|
And see the SignifyTS PR WebOfTrust/signify-ts#376 for the TypeScript client-side implementation of this. |
Signed-off-by: Kent Bull <kent@kentbull.com>
5b703bd to
9810ff8
Compare
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.
This adds AgentSignals, SseBroadcaster, SseBroadcasterDoer, SignalsStreamEnd , and SseEventIterable to support Signify clients connecting to a server sent events stream from a given Agent to any connected clients for that agent.
This is in preparation for future event driven features including the did:webs integration, among others. The SSE event stream is also a convenient way for clients to switch from long-polling to observing events sent from an agent. Long-polling can still be supported as a fallback, though SSE can be the default. This will significantly help with both bandwidth and performance on highly used Agency servers.
The
SseEventIterableuses the same pattern as KERIpy'sQryRpyMailboxIterableto leverage Falcon'srep.streamto open an SSE event stream to the client. Wrapping theSseBroadcaster.subscribearound theSseEventIterableallows HIO to asynchronously service the WSGI's synchronous SSE connection client.