You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-2Lines changed: 34 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,41 @@ and to your application target, add `ServiceLifecycle` to your dependencies:
28
28
29
29
### Using ServiceLifecycle
30
30
31
-
You can find the documentation on how to use ServiceLifecycle over [here](https://swiftpackageindex.com/swift-server/swift-service-lifecycle/main/documentation/lifecycle).
31
+
Below is a short usage example however you can find detailed documentation on how to use ServiceLifecycle over [here](https://swiftpackageindex.com/swift-server/swift-service-lifecycle/main/documentation/lifecycle).
32
32
33
-
Do not hesitate to get in touch as well, over on https://forums.swift.org/c/server.
33
+
ServiceLifecycle consists of two main building blocks. First, the `Service` protocol and secondly
34
+
the `ServiceGroup`. As a library or application developer you should model your long-running work
35
+
as services that implement the `Service` protocol. The protocol only requires a single `func run() async throws`
36
+
method to be implemented.
37
+
Afterwards, in your application you can use the `ServiceGroup` to orchestrate multiple services.
38
+
The group will spawn a child task for each service and call the respective `run` method in the child task.
39
+
Furthermore, the group will setup signal listeners for the configured signals and trigger a graceful shutdown
0 commit comments