Skip to content
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

URLSessionHTTPClient with GRPC support #322

Closed
aheze opened this issue Nov 26, 2024 · 1 comment
Closed

URLSessionHTTPClient with GRPC support #322

aheze opened this issue Nov 26, 2024 · 1 comment

Comments

@aheze
Copy link

aheze commented Nov 26, 2024

Currently the library only supports NIOHTTPClient if you're using GRPC:

let client = ProtocolClient(
    httpClient: NIOHTTPClient(host: host, port: port, timeout: 10),
    config: ProtocolClientConfig(
        host: host,
        networkProtocol: .grpc,
        codec: ProtoCodec()
    )
)

This makes the current streaming response stop when the app is backgrounded.

Is there any way to use URLSessionHTTPClient with GRPC? This is to take advantage of URLSessionConfiguration which supports continuing the task for a short while in the background.

Btw thanks for your work! Works smoothly and easy to set up 💪

@rebello95
Copy link
Collaborator

👋🏽 @aheze - the documentation notes that is not possible to use URLSession for gRPC because URLSession does not support/expose trailers. If URLSession exposes this in the future, we could support gRPC using that client 😃

There are a few threads online asking about using NIO in the background. If you'd like to explore that more, I recommend you file an issue in the NIO repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants