Skip to content

Commit 5c7eb0a

Browse files
committed
mention SPM
1 parent 8587618 commit 5c7eb0a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@ A Swift utility that provides a timeout mechanism for asynchronous operations us
1414
2. Integrate the `AsyncTimeout` structure into your project.
1515
3. Use the static `withTimeout` function to wrap the async operation that you want to time out.
1616

17+
### Swift Package Manager
18+
19+
Add the following to your Package.swift dependencies:
20+
21+
```swift
22+
dependencies: [
23+
.package(url: "https://github.com/RayKitajima/AsyncTimeout.git", from: "1.0.0"),
24+
],
25+
```
26+
1727
### Example:
1828

1929
```swift
30+
import AsyncTimeout
31+
2032
do {
2133
let result: YourReturnType = try await AsyncTimeout.withTimeout(seconds: 5) {
2234
return try await someAsyncFunc()

0 commit comments

Comments
 (0)