Skip to content

Commit

Permalink
Update README.md (#197)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
FranzBusch authored Jan 13, 2025
1 parent 24ea917 commit c641ece
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ the configured signals and trigger a graceful shutdown on each service.
import ServiceLifecycle
import Logging

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

0 comments on commit c641ece

Please sign in to comment.