Skip to content

Commit 6dde12a

Browse files
authored
update readme to reflect api changes (#41)
1 parent 19c5224 commit 6dde12a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you have a server-side Swift application or a cross-platform (e.g. Linux, mac
1717
To add a dependency on the package, declare it in your `Package.swift`:
1818

1919
```swift
20-
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "1.0.0-alpha.2"),
20+
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "1.0.0-alpha.3"),
2121
```
2222

2323
and to your application target, add "SwiftServiceLifecycle" to your dependencies:
@@ -93,7 +93,7 @@ In larger Applications (Services) `ComponentLifecycle` can be used to manage the
9393

9494
### Registering items
9595

96-
`ServiceLifecycle` and `ComponentLifecycle` are containers for `Lifecycle.Task`s which need to be registered via one of the following variants:
96+
`ServiceLifecycle` and `ComponentLifecycle` are containers for `LifecycleTask`s which need to be registered via one of the following variants:
9797

9898
You can register simple blocking throwing handlers using:
9999

@@ -111,9 +111,9 @@ func register(label: String, start: Handler, shutdown: Handler)
111111
func registerShutdown(label: String, _ handler: Handler)
112112
```
113113

114-
where `Lifecycle.Handler` is a container for an asynchronous closure defined as `(@escaping (Error?) -> Void) -> Void`
114+
where `LifecycleHandler` is a container for an asynchronous closure defined as `(@escaping (Error?) -> Void) -> Void`
115115

116-
`Lifecycle.Handler` comes with static helpers named `async` and `sync` designed to help simplify the registration call to:
116+
`LifecycleHandler` comes with static helpers named `async` and `sync` designed to help simplify the registration call to:
117117

118118
```swift
119119
let foo = ...
@@ -135,12 +135,12 @@ lifecycle.registerShutdown(
135135
```
136136

137137

138-
you can also register a collection of `Lifecycle.Task`s (less typical) using:
138+
you can also register a collection of `LifecycleTask`s (less typical) using:
139139

140140
```swift
141-
func register(_ tasks: [Lifecycle.Task])
141+
func register(_ tasks: [LifecycleTask])
142142

143-
func register(_ tasks: Lifecycle.Task...)
143+
func register(_ tasks: LifecycleTask...)
144144
```
145145

146146
### Configuration
@@ -211,7 +211,7 @@ In more complex cases, when `Signal`-trapping-based shutdown is not appropriate,
211211

212212
In larger Applications (Services) `ComponentLifecycle` can be used to manage the lifecycle of subsystems, such that `ServiceLifecycle` can start and shutdown `ComponentLifecycle`s.
213213

214-
In fact, since `ComponentLifecycle` conforms to `Lifecycle.Task`,
214+
In fact, since `ComponentLifecycle` conforms to `LifecycleTask`,
215215
it can start and stop other `ComponentLifecycle`s, forming a tree. E.g.:
216216

217217
```swift
@@ -249,7 +249,7 @@ lifecycle.wait()
249249

250250
SwiftServiceLifecycle comes with a compatibility module designed to make managing SwiftNIO based resources easy.
251251

252-
Once you import `LifecycleNIOCompat` module, `Lifecycle.Handler` gains a static helper named `eventLoopFuture` designed to help simplify the registration call to:
252+
Once you import `LifecycleNIOCompat` module, `LifecycleHandler` gains a static helper named `eventLoopFuture` designed to help simplify the registration call to:
253253

254254
```swift
255255
let foo = ...

0 commit comments

Comments
 (0)