Skip to content

Instance Method

run()

The service group calls this method when it starts the service.
func run() async throws

Discussion

Your implementation should execute its long running work in this method such as:

  • Handling incoming connections and requests

  • Background refreshes

Important

Returning or throwing from this method indicates the service should stop and causes the ServiceGroup to follow behaviors for the child tasks of all other running services specified in ServiceGroupConfiguration/ServiceConfiguration/successTerminationBehavior and ServiceGroupConfiguration/ServiceConfiguration/failureTerminationBehavior.