Skip to content

Commit 0c9056b

Browse files
Sajjontomerd
andauthored
Tweak README. (#52)
Co-authored-by: tomer doron <[email protected]>
1 parent 7afb846 commit 0c9056b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Swift Service Lifecycle
22

33
Swift Service Lifecycle provides a basic mechanism to cleanly start up and shut down the application, freeing resources in order before exiting.
4-
It also provides a `Signal`-based shutdown hook, to shutdown on signals like `TERM` or `INT`.
4+
It also provides a `Signal`-based shutdown hook, to shut down on signals like `TERM` or `INT`.
55

66
Swift Service Lifecycle was designed with the idea that every application has some startup and shutdown workflow-like-logic which is often sensitive to failure and hard to get right.
77
The library codes this common need in a safe and reusable way that is non-framework specific, and designed to be integrated with any server framework or directly in an application.
@@ -85,15 +85,15 @@ lifecycle.wait()
8585
The main types in the library are `ServiceLifecycle` and `ComponentLifecycle`.
8686

8787
`ServiceLifecycle` is the most commonly used type.
88-
It is designed to manage the top level Application (Service) lifecycle,
88+
It is designed to manage the top-level Application (Service) lifecycle,
8989
and in addition to managing the startup and shutdown flows it can also set up `Signal` trap for shutdown and install backtraces.
9090

9191
`ComponentLifecycle` manages a state machine representing the startup and shutdown logic flow.
9292
In larger Applications (Services) `ComponentLifecycle` can be used to manage the lifecycle of subsystems, such that `ServiceLifecycle` can start and shutdown `ComponentLifecycle`s.
9393

9494
### Registering items
9595

96-
`ServiceLifecycle` and `ComponentLifecycle` are containers for `LifecycleTask`s which need to be registered using a `LifecycleHandler` - a container for synchronous or asynchronous closures.
96+
`ServiceLifecycle` and `ComponentLifecycle` are containers for `LifecycleTask`s which need to be registered using a `LifecycleHandler` - a container for synchronous or asynchronous closures.
9797

9898
Synchronous handlers are defined as `() throws -> Void`.
9999

@@ -156,11 +156,11 @@ func register(_ tasks: LifecycleTask...)
156156

157157
* `shutdownSignal`: Defines what, if any, signals to trap for invoking shutdown. By default, `INT` and `TERM` are trapped.
158158

159-
* `installBacktrace`: Defines if to install a crash signal trap that prints backtraces. This is especially useful for application running on Linux since Swift does not provide backtraces on Linux out of the box. This functionality is provided via the [Swift Backtrace](https://github.com/swift-server/swift-backtrace) library.
159+
* `installBacktrace`: Defines if to install a crash signal trap that prints backtraces. This is especially useful for applications running on Linux since Swift does not provide backtraces on Linux out of the box. This functionality is provided via the [Swift Backtrace](https://github.com/swift-server/swift-backtrace) library.
160160

161161
### Starting the lifecycle
162162

163-
Use `start` function to start the application.
163+
Use the `start` function to start the application.
164164
Start handlers passed using the `register` function will be called in the order the items were registered in.
165165

166166
`start` is an asynchronous operation.
@@ -178,7 +178,7 @@ lifecycle.start { error in
178178

179179
### Shutdown
180180

181-
Typical use of the library is to call on `wait` after calling `start`.
181+
The typical use of the library is to call on `wait` after calling `start`.
182182

183183
```swift
184184
lifecycle.start { error in

0 commit comments

Comments
 (0)