【发布时间】:2022-06-11 15:45:17
【问题描述】:
我正在使用https://github.com/grpc/grpc-swift 进行进程间通信。我有一个用 Go 编写的 GRPC 服务器,它侦听一个 unix 域套接字,还有一个用 Swift 编写的 macOS 应用程序,它通过套接字与其通信。
假设 Go 服务器进程未运行,我从 Swift 程序进行 RPC 调用。调用失败前的默认超时时间为 20 秒,但我想将其缩短为 1 秒。我正在尝试做这样的事情:
let callOptions = CallOptions(timeLimit: .seconds(1)) // <-- Does not compile
编译错误类型'TimeLimit' has no member 'seconds'失败。
减少 Swift GRPC 调用超时间隔的正确方法是什么?
【问题讨论】:
标签: grpc grpc-swift