Skip to content

Commit c641ece

Browse files
authored
Update README.md (#197)
The readme shows an actor implementing the `Service` protocol. This has lead to some people thinking that only actors can do this so let's switch this to a `class` which is the usual type conforming to `Service`.
1 parent 24ea917 commit c641ece

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ the configured signals and trigger a graceful shutdown on each service.
6666
import ServiceLifecycle
6767
import Logging
6868

69-
actor FooService: Service {
69+
// A service can be implemented by a struct, class or actor. For this example we are using a struct.
70+
struct FooService: Service {
7071
func run() async throws {
7172
print("FooService starting")
7273
try await Task.sleep(for: .seconds(10))

0 commit comments

Comments
 (0)