httpwg/http2-spec 3552
Working copy of the HTTP/2 Specification
grpc/grpc-swift 1317
The Swift language implementation of gRPC.
apple/swift-crypto 1053
Open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms.
SwiftNIO SSH is a programmatic implementation of SSH using SwiftNIO
apple/swift-nio-transport-services 194
Extensions for SwiftNIO to support Apple platforms as first-class citizens.
apple/swift-http-structured-headers 96
A Swift implementation of the HTTP Structured Header Field specification.
Network protocol implementations in Python, sans I/O
Badass encryption for Twitter
Static file management for everyone.
pull request commentpsf/requests
Add support for brotli decoding
I apologize If this might come off as a bit rude but this PR seems to be the only thing blocking 2.26.0 milestone (the other changes in it have no pending change requested), and it's been a month without any progress, if for more time is needed that's of course understandable but would it be possible to bump this for the next release then so as not to have it block other changes from being released?
comment created time in 41 minutes
Pull request review commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
func main() async { print(", response:", String(buffer: response2.body ?? ByteBuffer())) try await channel.close()++ try await group.shutdownGracefully()
Lemme add the shutdown to the catch.
comment created time in an hour
Pull request review commenthttpwg/http-extensions
Add a section for http prioritization in transport retransmission
signal the intended priority to the client by including the Priority field in a PUSH_PROMISE or HEADERS frame. +# Retransmission Scheduling++A transport may detect packet losses and then retranmit lost information to+provide reliability. Examples include TCP and QUIC. While this document+specifies HTTP layer prioritization, its effectiveness can be further achieved+if transport layer also respect such priorities. Besides scheduling new data,+transport implementations MAY also consider stream priorities during+retransmission. In this section we will use QUIC as an example to discusss a+couple scenarios an implementation need to consider.++{{!I-D.ietf-quic-transport}}, Section 13.3 states that endpoints SHOULD +prioritize retransmission over sending new data, unless otherwise specified by+application. When an HTTP/3 application uses priority scheme defined in this +document, the QUIC transport layer MAY take stream priorities as input to +scheduling the sending of both retransmission data and new data. For example, +if one stream with higher urgency has new data to send and another stream with +lower urgency has retransmission data to send, a QUIC transport may choose to +schedule the higher urgency new data before the lower urgency retransmission+data.
I think this newer text indeed better reflects what we should be saying here, and also highlights the tradeoffs.
comment created time in an hour
Pull request review commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
extension EventLoopFuture { } } +extension EventLoopGroup {+ /// Shuts down the event loop gracefully.+ @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)+ @inlinable+ public func shutdownGracefully() async throws {+ return try await withCheckedThrowingContinuation { cont in+ self.shutdownGracefully { error in+ if let error = error {+ cont.resume(throwing: error)+ }+ cont.resume()
Of course, oops. I forgot the early-return/switch/else here. Total fail 😅.
comment created time in an hour
Pull request review commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
func main() async { print(", response:", String(buffer: response2.body ?? ByteBuffer())) try await channel.close()++ try await group.shutdownGracefully()
Yes, I noticed this.
I wasn't able able to use the defer shutdown with the async, and because the comments said it was safe to call shutdown twice, I thought the safest thing to do was to leave the top-level shutdown.
I'll move the group lifecycle into the async function, though as it's probably the right thing to do.
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
pull request commentapple/swift-nio
Add async implementation of EventLoopGroup.shutdownGracefully to _NIOConcurrency
Can one of the admins verify this patch?
comment created time in an hour
PR opened apple/swift-nio
Adds a new extension to EventLoopGroup in _NIOConcurrency to provide an asynchronous shutdownGracefully().
Motivation
Shutting down an event loop was special because it used a completion handler and executed on a DispatchQueue because there would be no event loop to use an EventLoopFuture.
Now we have the new Swift concurrency features, we can provide an async shutdownGracefully.
Fixes #1878.
Modifications
Adds EventLoopGroup.shutdownGracefully() async and some code to use it in NIOAsyncAwaitDemo.
There's no obvious way to ask an ELG if it has been shutdown but I made the following local-only changes to verify that this performs as expected:
diff --git a/Sources/NIO/EventLoop.swift b/Sources/NIO/EventLoop.swift
index d18a33dd..972b3b05 100644
--- a/Sources/NIO/EventLoop.swift
+++ b/Sources/NIO/EventLoop.swift
@@ -840 +840 @@ public final class MultiThreadedEventLoopGroup: EventLoopGroup {
- private enum RunState {
+ public enum RunState {
@@ -852 +852 @@ public final class MultiThreadedEventLoopGroup: EventLoopGroup {
- private var runState: RunState = .running
+ public var runState: RunState = .running
diff --git a/Sources/NIOAsyncAwaitDemo/main.swift b/Sources/NIOAsyncAwaitDemo/main.swift
index 97a9c0c3..f8b29ace 100644
--- a/Sources/NIOAsyncAwaitDemo/main.swift
+++ b/Sources/NIOAsyncAwaitDemo/main.swift
@@ -60,0 +61 @@ func main() async {
+ print("elg state: \(group.runState)") // .running
@@ -61,0 +63,7 @@ func main() async {
+ print("elg state: \(group.runState)") // .closed(nil)
+
+ /// This causes the following error:
+ /// ERROR: Cannot schedule tasks on an EventLoop that has already shut down. This will be upgraded to a forced crash in future SwiftNIO versions.
+ group.next().execute {
+ print("This will not execute.")
+ }
pr created time in an hour
Pull request review commenturllib3/urllib3
Add --ignore-missing-imports flag to mypy run command.
def _normalize_host( def _idna_encode(name: str) -> bytes: if name and any([ord(x) > 128 for x in name]): try:- import idna # type: ignore+ import idna
Ok, I will create a new PR for this.
comment created time in 2 hours
push eventhttpwg/http-extensions
commit sha 1dd001c40f4c28ec82ee48488fead948fb570e59
Script updating gh-pages from 26b6826. [ci skip]
push time in 2 hours
PR opened httpwg/http-extensions
This PR
- [x] adds Content-Digest
- [x] adds Want-Content-Digest
- [ ] add examples
- [ ] do we need a further rationale on the discussion?
pr created time in 2 hours
issue openedhttpwg/http-extensions
I expect
- [ ] content-digest field
- [ ] want-content-digest field
created time in 2 hours
issue commenthttpwg/http-extensions
Registration policy for digest algorithm values
Related to #1394
comment created time in 3 hours
pull request commenthttpwg/http-extensions
Add a section for http prioritization in transport retransmission
Thank you @LPardue . All the suggested changes were really good. :)
I don't have a strong opinion when it comes to MAY vs SHOULD in the retransmission data. Personally I think if transport considers priorities in retx as well, application developers building features on top of the transport implementation are less likely to be surprised.
comment created time in 6 hours
Pull request review commenturllib3/urllib3
Add --ignore-missing-imports flag to mypy run command.
def _normalize_host( def _idna_encode(name: str) -> bytes: if name and any([ord(x) > 128 for x in name]): try:- import idna # type: ignore+ import idna
Let's do that!
comment created time in 10 hours
pull request commentpython-hyper/wsproto
I changed the host to include non-ascii characters.
For the moment it's the only way I found to make sure it works with non-ascii character, as in order to make sure idna is used, I will have to use private functions, namely H11Handshake._initiate_connection and H11Handshake._process_connection_request, as Unicode is used everywhere, for instance in the result of next(server.events()) (line 14 of test/test_handshake.py)
comment created time in 12 hours