-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Streamable functions - Change "stream()" signature. #14497
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
Closed
eBlender
wants to merge
29
commits into
firebase:streamable-functions
from
eBlender:streamable-functions
Closed
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
7370352
Add tests to cover new API
eBlender 5d36f3e
Update Tests
eBlender 7f1d359
Update IntegrationTests.swift
eBlender 1e4e0dc
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender 1e769cc
Update FirebaseFunctions/Tests/Integration/IntegrationTests.swift
eBlender 05700ea
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender b28c712
Update for CI
eBlender 892a180
Change API stream and Tests.
eBlender 3910d5e
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender 2b943f1
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender ca4632c
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender f8f094c
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender 934110e
Revert TODO
eBlender 8558021
Merge branch 'streamable-functions' of https://github.com/eBlender/fi…
eBlender 0adbe2a
Update Callable+Codable.swift
eBlender 84c89c4
Update FirebaseFunctions/Tests/Unit/FunctionsTests.swift
eBlender 3c35320
Update FirebaseFunctions/Tests/Unit/FunctionsTests.swift
eBlender 92cddad
Update FirebaseFunctions/Tests/Integration/IntegrationTests.swift
eBlender 6917002
Update FirebaseFunctions/Tests/Integration/IntegrationTests.swift
eBlender 4c58a2f
Update FirebaseFunctions/Tests/Integration/IntegrationTests.swift
eBlender c7125e1
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender 7c4359a
Update FirebaseFunctions/Tests/Unit/FunctionsTests.swift
eBlender 9bd6c73
Update FirebaseFunctions/Tests/Integration/IntegrationTests.swift
eBlender d5c0ddc
Update FirebaseFunctions/Sources/Callable+Codable.swift
eBlender 9d7e01e
Update FirebaseFunctions/Tests/Integration/IntegrationTests.swift
eBlender 7e88c4d
Merge branch 'streamable-functions' of https://github.com/eBlender/fi…
eBlender 1ebe1a0
Merge branch 'streamable-functions' into streamable-functions
eBlender c267d0a
Merge branch 'streamable-functions' of https://github.com/eBlender/fi…
eBlender 6934e80
Update IntegrationTests.swift
eBlender File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,7 +107,7 @@ public struct Callable<Request: Encodable, Response: Decodable> { | |
| /// - Parameter completion: The block to call when the HTTPS request has completed. | ||
| public func call(_ data: Request, | ||
| completion: @escaping (Result<Response, Error>) | ||
| -> Void) { | ||
| -> Void) { | ||
| do { | ||
| let encoded = try encoder.encode(data) | ||
|
|
||
|
|
@@ -154,7 +154,7 @@ public struct Callable<Request: Encodable, Response: Decodable> { | |
| /// - completion: The block to call when the HTTPS request has completed. | ||
| public func callAsFunction(_ data: Request, | ||
| completion: @escaping (Result<Response, Error>) | ||
| -> Void) { | ||
| -> Void) { | ||
| call(data, completion: completion) | ||
| } | ||
|
|
||
|
|
@@ -214,7 +214,8 @@ public extension Callable { | |
| // TODO: Look into handling parameter-less functions. | ||
| // TODO: Ensure decoding failures are passed into reasonable errors. | ||
| @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) | ||
| func stream(_ data: Request) -> AsyncThrowingStream<Response, Error> { | ||
| func stream(_ data: Request? = nil) -> AsyncThrowingStream<Response, 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. Could you revert the changes in the file apart from this line? |
||
|
|
||
| return AsyncThrowingStream { continuation in | ||
| Task { | ||
| do { | ||
|
|
@@ -251,14 +252,14 @@ public extension Callable { | |
| ) | ||
| continuation.yield(boxedMessage.message) | ||
| } | ||
|
|
||
| } | ||
| } catch { | ||
| continuation.finish(throwing: error) | ||
| continuation.finish() | ||
| } | ||
| continuation.finish() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
||
| struct StreamResponseMessage<Message: Decodable>: Decodable { | ||
|
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.