MultiThreadedEventLoopGroup has been replaced with NIOTSEventLoopGroup. It's recommended by authors of grpc-swift especially for iOS platform and it allows us to set the priority because NIOTSEventLoopGroup is GCD based while MultiThreadedEventLoopGroup is pthread based. [#541] Initialise gRPC on a separate thread (#545) - priority increased to .default
This commit is contained in:
parent
46d8c04afc
commit
fa5bbbb2bf
|
@ -10,6 +10,7 @@ import Foundation
|
|||
import GRPC
|
||||
import NIO
|
||||
import NIOHPACK
|
||||
import NIOTransportServices
|
||||
|
||||
public typealias Channel = GRPC.GRPCChannel
|
||||
|
||||
|
@ -127,8 +128,8 @@ public class LightWalletGRPCService {
|
|||
self.singleCallTimeout = TimeLimit.timeout(.milliseconds(singleCallTimeout))
|
||||
|
||||
let connectionBuilder = secure ?
|
||||
ClientConnection.usingPlatformAppropriateTLS(for: MultiThreadedEventLoopGroup(numberOfThreads: 1)) :
|
||||
ClientConnection.insecure(group: MultiThreadedEventLoopGroup(numberOfThreads: 1))
|
||||
ClientConnection.usingPlatformAppropriateTLS(for: NIOTSEventLoopGroup(loopCount: 1, defaultQoS: .default)) :
|
||||
ClientConnection.insecure(group: NIOTSEventLoopGroup(loopCount: 1, defaultQoS: .default))
|
||||
|
||||
let channel = connectionBuilder
|
||||
.withConnectivityStateDelegate(connectionManager, executingOn: queue)
|
||||
|
|
|
@ -11,6 +11,7 @@ import GRPC
|
|||
import ZcashLightClientKit
|
||||
import XCTest
|
||||
import NIO
|
||||
import NIOTransportServices
|
||||
|
||||
enum Environment {
|
||||
static let lightwalletdKey = "LIGHTWALLETD_ADDRESS"
|
||||
|
@ -40,8 +41,8 @@ class ChannelProvider {
|
|||
let endpoint = LightWalletEndpointBuilder.default
|
||||
|
||||
let connectionBuilder = secure ?
|
||||
ClientConnection.usingPlatformAppropriateTLS(for: MultiThreadedEventLoopGroup(numberOfThreads: 1)) :
|
||||
ClientConnection.insecure(group: MultiThreadedEventLoopGroup(numberOfThreads: 1))
|
||||
ClientConnection.usingPlatformAppropriateTLS(for: NIOTSEventLoopGroup(loopCount: 1, defaultQoS: .default)) :
|
||||
ClientConnection.insecure(group: NIOTSEventLoopGroup(loopCount: 1, defaultQoS: .default))
|
||||
|
||||
let channel = connectionBuilder
|
||||
.withKeepalive(
|
||||
|
|
Loading…
Reference in New Issue