-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Streamable functions - Continuation of #14395 #14465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
7370352
5d36f3e
7f1d359
1e4e0dc
1e769cc
05700ea
b28c712
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1011,6 +1011,22 @@ class IntegrationTests: XCTestCase { | |
| } | ||
| } | ||
|
|
||
| @available(iOS 15.0, *) | ||
| func testGenStreamContent() async throws { | ||
|
|
||
eBlender marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| let callable: Callable<String, StreamResponse<String, String>> = functions.httpsCallable("genStream") | ||
| let stream = callable.stream("genStream") | ||
| //Todo fetch actual content. | ||
| for try await response in stream { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eBlender, w.r.t. your comment about it not parsing it, is the issue that this is throwing a parsing error? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is the part where we don't get a proper response. Any other type that will do fine, <T, T> as examples above. |
||
| switch response { | ||
| case .message(let message): | ||
| print("Message: \(message)") | ||
| case .result(let result): | ||
| print("Result: \(result)") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private func response(from stream: AsyncThrowingStream<HTTPSCallableResult, | ||
| any Error>) async throws -> [String] { | ||
| var response = [String]() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.