mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-15 01:18:58 +08:00
format
This commit is contained in:
parent
6688e3a3f4
commit
93fb096943
@ -13,8 +13,8 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import NIOCore
|
|
||||||
import NIOConcurrencyHelpers
|
import NIOConcurrencyHelpers
|
||||||
|
import NIOCore
|
||||||
import NIOExtras
|
import NIOExtras
|
||||||
|
|
||||||
class HTTP1ThreadedPCapPerformanceTest: HTTP1ThreadedPerformanceTest {
|
class HTTP1ThreadedPCapPerformanceTest: HTTP1ThreadedPerformanceTest {
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
import NIOCore
|
|
||||||
import NIOConcurrencyHelpers
|
import NIOConcurrencyHelpers
|
||||||
|
import NIOCore
|
||||||
import NIOHTTP1
|
import NIOHTTP1
|
||||||
import NIOPosix
|
import NIOPosix
|
||||||
|
|
||||||
@ -108,7 +108,9 @@ final class RepeatedRequests: ChannelInboundHandler {
|
|||||||
let reqPart = self.unwrapInboundIn(data)
|
let reqPart = self.unwrapInboundIn(data)
|
||||||
if case .end(nil) = reqPart {
|
if case .end(nil) = reqPart {
|
||||||
if self.remainingNumberOfRequests <= 0 {
|
if self.remainingNumberOfRequests <= 0 {
|
||||||
context.channel.close().assumeIsolated().map { self.doneRequests }.nonisolated().cascade(to: self.isDonePromise)
|
context.channel.close().assumeIsolated().map { self.doneRequests }.nonisolated().cascade(
|
||||||
|
to: self.isDonePromise
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
self.doneRequests += 1
|
self.doneRequests += 1
|
||||||
self.remainingNumberOfRequests -= 1
|
self.remainingNumberOfRequests -= 1
|
||||||
@ -177,7 +179,7 @@ class HTTP1ThreadedPerformanceTest: Benchmark {
|
|||||||
clientChannels.reserveCapacity(self.numberOfClients)
|
clientChannels.reserveCapacity(self.numberOfClients)
|
||||||
for _ in 0..<self.numberOfClients {
|
for _ in 0..<self.numberOfClients {
|
||||||
let clientChannel = try! ClientBootstrap(group: self.group)
|
let clientChannel = try! ClientBootstrap(group: self.group)
|
||||||
.channelInitializer { [head = self.head, requestsPerClient = self.requestsPerClient, extraInitialiser = self.extraInitialiser] channel in
|
.channelInitializer { [head, requestsPerClient, extraInitialiser] channel in
|
||||||
channel.eventLoop.makeCompletedFuture {
|
channel.eventLoop.makeCompletedFuture {
|
||||||
let sync = channel.pipeline.syncOperations
|
let sync = channel.pipeline.syncOperations
|
||||||
try sync.addHTTPClientHandlers()
|
try sync.addHTTPClientHandlers()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user