Skip to content

Commit cb50499

Browse files
committed
chore: refine documentation.
1 parent b5d25d5 commit cb50499

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function. This reduces potential issues that can arise from wait being a thread-
4848

4949
If you've scrolled this far, you probably saw the warning. But just to make sure…
5050

51-
> ⚠️ WARNING - This is an 🧪experimental🧪 repository and should not be adopted at large.
51+
> ⚠️ WARNING - This is an 🧪experimental🧪 repository and should not be adopted at large at the present time.
5252
5353
PassiveLogic is [actively working](https://github.com/PassiveLogic/swift-web-examples/issues/1) to mainstream this into the SwiftWasm
5454
toolchain. But if you can't wait, here are some tips.
@@ -69,15 +69,14 @@ import Dispatch
6969

7070
## 2. If you really want to use DispatchAsync as a pure Swift Dispatch alternative for non-wasm targets
7171

72-
Stop. Are you sure? If you do this, you'll need to be '
72+
Stop. Are you sure? If you do this, you'll need to be careful with all `import Dispatch`, `import Foundation`, and many other issues.
7373

7474
1. Add the dependency to your package:
7575

7676
```swift
7777
let package = Package(
7878
name: "MyPackage",
7979
products: [
80-
// Products define the executables and libraries a package produces, making them visible to other packages.
8180
.library(
8281
name: "MyPackage",
8382
targets: [
@@ -95,7 +94,7 @@ let package = Package(
9594
.target(
9695
name: "MyPackage"
9796
dependencies: [
98-
"DispatchAsync"
97+
.product(name: "DispatchAsync", package: "swift-dispatch-async", condition: .when(platforms: [.wasi])),
9998
]
10099
),
101100
]

Sources/DispatchAsync/DispatchGroup.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ extension DispatchAsync {
2929
///
3030
/// The primary goal of this implementation is to enable WASM support for Dispatch.
3131
///
32-
/// Refer to documentation for the original [DispatchGroup](https://developer.apple.com/documentation/dispatch/dispatchgroup)
33-
/// for more details,
32+
/// For more details, refer to the original [DispatchGroup](https://developer.apple.com/documentation/dispatch/dispatchgroup)
3433
#if !os(WASI)
3534
@_spi(DispatchAsync)
3635
#endif

Sources/DispatchAsync/DispatchQueue.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ extension DispatchAsync {
2727
///
2828
/// The primary goal of this implementation is to enable WASM support for Dispatch.
2929
///
30-
/// Refer to documentation for the original [DispatchQueue](https://developer.apple.com/documentation/dispatch/dispatchqueue)
31-
/// for more details,
30+
/// For more details, refer to the original [DispatchQueue](https://developer.apple.com/documentation/dispatch/dispatchqueue)
3231
#if !os(WASI)
3332
@_spi(DispatchAsync)
3433
#endif

Sources/DispatchAsync/DispatchSemaphore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extension DispatchAsync {
3333
/// For safety, this class is only defined for WASI platforms.
3434
///
3535
/// Most wasm executables are single-threaded. Calling DispatchSemaphore.wait
36-
/// when it's value is 0 or lower would be likely cause a frozen main thread,
36+
/// when its value is 0 or lower would be likely cause a frozen main thread,
3737
/// because that would block the calling thread. And there is usually
3838
/// only one thread in the wasm world (right now).
3939
///

Sources/DispatchAsync/DispatchTime.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension DispatchAsync {
4646
private static let uptimeBeginning: ContinuousClock.Instant = ContinuousClock.Instant.now
4747

4848
/// See documentation for ``uptimeBeginning``. We intentionally
49-
/// use this to guarantee a capture of `now` to uptimeBeginnin BEFORE
49+
/// use this to guarantee a capture of `now` to `uptimeBeginning` BEFORE
5050
/// any DispatchTime instances are initialized.
5151
private let durationSinceUptime = uptimeBeginning.duration(to: ContinuousClock.Instant.now)
5252

0 commit comments

Comments
 (0)