Skip to content

Commit

Permalink
Merge branch 'main' into fb-benchmark-update-thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzBusch authored Jul 13, 2024
2 parents d14d7a9 + eea0f74 commit a6a8a9c
Show file tree
Hide file tree
Showing 18 changed files with 528 additions and 400 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ jobs:
name: Checks
uses: ./.github/workflows/reusable_pull_request.yml
with:
benchmarks_linux_package_path: "Benchmarks"
benchmarks_linux_package_path: "Benchmarks"
license_header_check_project_name: "SwiftNIO"
format_check_enabled: false
59 changes: 57 additions & 2 deletions .github/workflows/reusable_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ on:
type: string
description: "List of unacceptable words. Defaults to a sensible list of words."
default: "blacklist whitelist slave master sane sanity insane insanity kill killed killing hang hung hanged hanging" #ignore-unacceptable-language
license_header_check_enabled:
type: boolean
description: "Boolean to enable the license header check job. Defaults to true."
default: true
license_header_check_project_name:
type: string
description: "Name of the project called out in the license header."
required: true
broken_symlink_check_enabled:
type: boolean
description: "Boolean to enable the broken symlink check job. Defaults to true."
default: true
format_check_enabled:
type: boolean
description: "Boolean to enable the format check job. Defaults to true."
default: true

## We are cancelling previously triggered workflow runs
concurrency:
Expand Down Expand Up @@ -122,7 +138,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run documentation check
run: ./scripts/check-docs.sh
run: |
apt-get -qq update && apt-get -qq -y install curl
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-docs.sh | bash
unacceptable-language-check:
name: Unacceptable language check
Expand All @@ -135,4 +153,41 @@ jobs:
- name: Run unacceptable language check
env:
UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}}
run: ./scripts/check-unacceptable-language.sh
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-unacceptable-language.sh | bash

license-header-check:
name: License headers check
if: ${{ inputs.license_header_check_enabled }}
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run license header check
env:
PROJECT_NAME: ${{ inputs.license_header_check_project_name }}
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-license-header.sh | bash

broken-symlink-check:
name: Broken symlinks check
if: ${{ inputs.broken_symlink_check_enabled }}
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run broken symlinks check
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-broken-symlinks.sh | bash

format-check:
name: Format check
if: ${{ inputs.format_check_enabled }}
runs-on: ubuntu-latest
container:
image: swiftlang/swift:nightly-6.0-jammy
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run format check
run: swift format lint --parallel --recursive --strict
47 changes: 47 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.gitignore
**/.gitignore
.licenseignore
.gitattributes
.mailfilter
.mailmap
.spi.yml
.swift-format
.github/*
*.md
*.txt
*.yml
*.yaml
*.json
Package.swift
**/Package.swift
Package@-*.swift
**/Package@-*.swift
Package.resolved
**/Package.resolved
Makefile
*.modulemap
**/*.modulemap
**/*.docc/*
*.xcprivacy
**/*.xcprivacy
*.symlink
**/*.symlink
Dockerfile
**/Dockerfile
Snippets/*
Sources/CNIOAtomics/src/cpp_magic.h
Sources/CNIOLLHTTP/LICENSE-MIT
Sources/CNIOLLHTTP/c_nio_api.c
Sources/CNIOLLHTTP/c_nio_http.c
Sources/CNIOLLHTTP/c_nio_llhttp.c
Sources/CNIOLLHTTP/include/c_nio_llhttp.h
Sources/CNIOSHA1/c_nio_sha1.c
Sources/CNIOSHA1/include/CNIOSHA1.h
dev/alloc-limits-from-test-output
dev/boxed-existentials.d
dev/git.commit.template
dev/lldb-smoker
dev/make-single-file-spm
dev/malloc-aggregation.d
dev/update-alloc-limits-to-last-completed-ci-build
scripts/nio-diagnose
13 changes: 0 additions & 13 deletions Benchmarks/Package.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
// swift-tools-version: 5.7
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftCertificates open source project
//
// Copyright (c) 2023 Apple Inc. and the SwiftCertificates project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftCertificates project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

import PackageDescription

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mallocCountTotal" : 12
"mallocCountTotal" : 10
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mallocCountTotal" : 12
"mallocCountTotal" : 10
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mallocCountTotal" : 12
"mallocCountTotal" : 10
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mallocCountTotal" : 12
"mallocCountTotal" : 10
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mallocCountTotal" : 12
"mallocCountTotal" : 10
}
37 changes: 29 additions & 8 deletions Sources/NIOCore/AsyncChannel/AsyncChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,27 @@ extension Channel {
) throws -> (NIOAsyncChannelInboundStream<Inbound>, NIOAsyncChannelOutboundWriter<Outbound>) {
self.eventLoop.assertInEventLoop()

let inboundStream = try NIOAsyncChannelInboundStream<Inbound>.makeWrappingHandler(
channel: self,
let handler = NIOAsyncChannelHandler<Inbound, Inbound, Outbound>(
eventLoop: self.eventLoop,
transformation: .syncWrapping { $0 },
isOutboundHalfClosureEnabled: isOutboundHalfClosureEnabled
)

let inboundStream = try NIOAsyncChannelInboundStream(
eventLoop: self.eventLoop,
handler: handler,
backPressureStrategy: backPressureStrategy,
closeOnDeinit: closeOnDeinit
)

let writer = try NIOAsyncChannelOutboundWriter<Outbound>(
channel: self,
eventLoop: self.eventLoop,
handler: handler,
isOutboundHalfClosureEnabled: isOutboundHalfClosureEnabled,
closeOnDeinit: closeOnDeinit
)

try self.pipeline.syncOperations.addHandler(handler)
return (inboundStream, writer)
}

Expand All @@ -338,17 +349,27 @@ extension Channel {
) throws -> (NIOAsyncChannelInboundStream<ChannelReadResult>, NIOAsyncChannelOutboundWriter<Never>) {
self.eventLoop.assertInEventLoop()

let inboundStream = try NIOAsyncChannelInboundStream<ChannelReadResult>.makeTransformationHandler(
channel: self,
let handler = NIOAsyncChannelHandler<Channel, ChannelReadResult, Never>(
eventLoop: self.eventLoop,
transformation: .transformation(channelReadTransformation: channelReadTransformation),
isOutboundHalfClosureEnabled: isOutboundHalfClosureEnabled
)

let inboundStream = try NIOAsyncChannelInboundStream(
eventLoop: self.eventLoop,
handler: handler,
backPressureStrategy: backPressureStrategy,
closeOnDeinit: closeOnDeinit,
channelReadTransformation: channelReadTransformation
closeOnDeinit: closeOnDeinit
)

let writer = try NIOAsyncChannelOutboundWriter<Never>(
channel: self,
eventLoop: self.eventLoop,
handler: handler,
isOutboundHalfClosureEnabled: isOutboundHalfClosureEnabled,
closeOnDeinit: closeOnDeinit
)

try self.pipeline.syncOperations.addHandler(handler)
return (inboundStream, writer)
}
}
Loading

0 comments on commit a6a8a9c

Please sign in to comment.