mirror of
https://github.com/apple/swift-nio-extras
synced 2026-11-26 04:57:49 +00:00
Motivation: In a few cases quiescing a server application is useful but it's harder than necessary with core-NIO. Therefore this adds a helper & a demonstration. Modifications: - add `QuiescingHelper` which helps users to quiesce a channel by collecting all accepted channels and when needed sends them the quiescing user event. When all collected channels have closed the user will be notified and can just shut down the ELG. - added a demo implementation with a simple HTTP server that quiesces when receiving a signal Result: Make it quite easy to quiesce a server and show users how to do it.
32 lines
840 B
Swift
32 lines
840 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// LinuxMain.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
#if os(Linux) || os(FreeBSD)
|
|
@testable import NIOExtrasTests
|
|
|
|
XCTMain([
|
|
testCase(QuiescingHelperTest.allTests),
|
|
])
|
|
#endif
|