Commit Graph

12 Commits

Author SHA1 Message Date
Cory Benfield a7c36a7654
Clean up and regression check the docs. (#2400)
Motivation:

Up until recently, it has not been possible to regression check our
documentation. However, in recent releases of the DocC plugin it has
become possible to make warnings into errors, making it possible for us
to CI our docs.

This patch adds support for doing that, and also cleans up our
documentation so that it successfully passes the check.

Along the way I accidentally wrote an `index.md` for `NIOCore` so I
figure we may as well keep it.

Modifications:

- Structure the documentation for NIOCore
- Fix up DocC issues
- Add `check-docs.sh` script to check the docs cleanly build
- Wire things up to our docker-compose scripts.

Result:

We can CI our docs.

Co-authored-by: George Barnett <gbarnett@apple.com>
2023-04-11 09:05:22 +01:00
Oleksandr Zhurba 555f1db039
Special case EventLoopPromise.succeed() when Value is Void (#2311)
Co-authored-by: OleksandrZhurba <56148913+OleksandrZhurba@users.noreply.github.com>
2023-01-19 09:06:07 -08:00
Cory Benfield a58500af68
Make EventLoopFuture.wait() unavailable from async (#2331)
Motivation:

ELF.wait() waits for a condition variable to become true, which can
frequently lead to extremely long waits. This is a bad thing to call on
a Swift Concurrency thread, especially as we have ELF.get() which is
preferable.

Modifications:

Make ELF.wait() unavailable from async.

Result:

Users are encouraged to use the correct primitive.
2022-12-12 06:13:24 -08:00
carolinacass af41276062
Use #fileID/#filePath instead of #file (#2306)
Motivation:

#fileID introduced in Swift 5.3, so no longer need to use #file anywhere

Modifications:

Changed #file to #filePath or #fileID depending on the situation
2022-11-03 16:43:13 +00:00
David Nadoba 16b5b2b793
Replace `NIOSendable` with `Sendable` (#2291) 2022-10-13 15:56:27 +01:00
David Nadoba c7b4989b02
Remove `#if compiler(>=5.5)` (#2292)
### Motivation
We only support Swift 5.5.2+.

### Modification
Remove all `#if swift(>=5.5)` conditional compilation blocks.

### Result
less branching
2022-10-13 07:17:46 -07:00
David Nadoba 0e2818bf86
Remove `@preconcurrency` from internal `EventLoopFuture` methods (#2135)
* add @preconcurrency again as it otherwise results in one more allcation in 1000_udpconnections
2022-06-07 07:09:44 -07:00
David Nadoba e16a340c57
Adopt `Sendable` for `EventLoopFuture` and `EventLoopPromise` (#2107)
* Adopt `Sendable` for `EventLoopFuture` and `EventLoopPromise`

* use internal typealias to deduplicate method bodies

* fix `Sendable` warnings for nightly toolchains

* fix compliation for Swift 5.5 & 5.6

* Adopt `Sendable` only in Swift 5.7+

Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-05-30 11:35:23 +01:00
BenedictSt d489d9f38f
Fixed some typos (#2051)
Fixed some typos.
2022-02-22 01:37:47 -08:00
Johannes Weiss 0697d5a599
remove/deprecate the file:line: parameters from flatMap and friends (#1998)
Motivation:

For NIO's 'promise leak detector' we added file:line: labels to
makePromise and there it makes sense. A user might create a promise and
then never fulfil it, bad. With the file:line: arguments we can give
good diagnostics.

However, we (probably that @weissi again) also added it to flatMap and
friends where it doesn't make sense at all.

Sure, EventLoopFuture's implementation may create a promise in the
implementation of flatMap but this promise is never leaked unless the
previous future is never fulfilled (or NIO has a terrible bug). Suffice
to say that in a future chain, it's never a flatMap etc which is
responsible for leaking the first promise...

Explain here the context, and why you're making that change.
What is the problem you're trying to solve.

Modifications:

Remove all unnecessary `file:line:` parameters whilst keeping the public
API intact.

Result:

More sensible code.
2021-12-03 08:27:55 -08:00
Adam Fowler 697503677d
Conform EventLoopFuture/Promise to Sendable (#1982)
* Conform EventLoopFuture/Promise to Sendable

* Only conform to Sendable if concurrency is available

* Add NIOSendable
2021-11-01 09:29:04 +00:00
Cory Benfield 25da619b78
Extract EventLoop protocols and EventLoopFuture to Core (#1898)
Motivation:

The next step on extracting the base abstractions is to pull out
EventLoop, EventLoopGroup and related types, and also EventLoopPromise
and EventLoopFuture. These types are fundamental to the API.

Modifications:

- Extract EventLoop, EventLoopGroup, and related types.
- Extract EventLoopPromise and EventLoopFuture.
- Add new @testable imports.
- Split MultiThreadedEventLoopGroup into new file, appropriately named.

Result:

Better separation.
2021-07-21 07:56:11 +01:00