POC PR for Addressing issue 26 and issue 25#27
Open
eye-dee wants to merge 2 commits intopratikbaid3:masterfrom
Open
POC PR for Addressing issue 26 and issue 25#27eye-dee wants to merge 2 commits intopratikbaid3:masterfrom
eye-dee wants to merge 2 commits intopratikbaid3:masterfrom
Conversation
2. Add tests
eye-dee
commented
Aug 7, 2024
| /// A client for subscribing to Server-Sent Events (SSE). | ||
| class SSEClient { | ||
| static http.Client _client = new http.Client(); | ||
| static StreamController<SSEModel> _streamController = StreamController(); |
Author
There was a problem hiding this comment.
Static stream limits the client to be used only once
eye-dee
commented
Aug 7, 2024
| header: {}, | ||
| ); | ||
|
|
||
| // TODO |
Author
There was a problem hiding this comment.
I am not sure about infinite retry
If I understood it correctly, it might cause stack overflow
maybe the method itself should be reworked to yield stream
Stream asynchronousNaturalsTo(n) async* {
int k = 0;
while (k < n) yield k++;
}
Owner
There was a problem hiding this comment.
This is a great sugggestion. I was also thinking of privigind a config object direct from the client using the package. This will allow more control over the newtwork calls.
878737d to
88c9b55
Compare
eye-dee
commented
Aug 7, 2024
| static StreamController<SSEModel> _streamController = StreamController(); | ||
| final http.Client _client; | ||
|
|
||
| SSEClient(this._client); |
Author
There was a problem hiding this comment.
Clients of the library will be responsible for managing the client
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.
POC PR for Addressing #26 and #25