-
Notifications
You must be signed in to change notification settings - Fork 435
Closed
Labels
kind/supportAdopter support requests.Adopter support requests.
Description
What are you trying to achieve?
After grpc-web is supported (#350), there's no update for the example about using grpc-web in client-side Swift.
There's update for server-side Swift in that PR, I believe.
What have you tried so far?
Created a demo project locally trying to set up client-side grpc-swift.
override func viewDidLoad() {
super.viewDidLoad()
let client = Greet_GreeterClient(channel: setupChannel())
var hellpRequest = Greet_HelloRequest()
hellpRequest.name = "demo"
client.sayHello(hellpRequest).response.whenComplete { (result) in
switch result {
case .success(let reply):
print("reply:", reply)
case .failure(let error):
print("error:", error)
}
}
}
func setupChannel() -> ClientConnection {
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
let channel = ClientConnection.insecure(group: group) // This looks like grpc instead of grpc-web, right?
.withBackgroundActivityLogger(self.clientLogger)
.connect(host: "127.0.0.1", port: 5000)
return channel
}
Metadata
Metadata
Assignees
Labels
kind/supportAdopter support requests.Adopter support requests.