Skip to content

Commit 6f3bbee

Browse files
committed
Remove long running property
1 parent 8d24edd commit 6f3bbee

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Sources/ServiceLifecycle/Service.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414

1515
/// This is the basic protocol that a service has to implement.
1616
public protocol Service: Sendable {
17-
/// This indicates if the service is expected to be running for the entire duration.
18-
/// If a long running service is returning from the ``Service/run()-1ougx`` method it is treated
19-
/// as an unexpected early exit and all other services are going be cancelled.
20-
var isLongRunning: Bool { get }
21-
2217
/// This method is called when the ``ServiceRunner`` is starting all the services.
2318
///
2419
/// Concrete implementation should execute their long running work in this method such as:
2520
/// - Handling incoming connections and requests
2621
/// - Background refreshes
22+
///
23+
/// - Important: Returning or throwing from this method is indicating a failure of the service and will cause the ``ServiceRunner``
24+
/// to cancel the child tasks of all other running services.
2725
func run() async throws
2826
}

Sources/ServiceLifecycle/ServiceRunner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import Logging
1616
import UnixSignals
1717

18-
/// A ``ServiceRunner`` is responsible for running a number of services, setting up signal handling and shutting down services in the correct order.
18+
/// A ``ServiceRunner`` is responsible for running a number of services, setting up signal handling and signalling graceful shutdown to the services.
1919
public actor ServiceRunner: Sendable {
2020
/// The internal state of the ``ServiceRunner``.
2121
private enum State {

Sources/ServiceLifecycle/ServiceRunnerConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public struct ServiceRunnerConfiguration: Hashable, Sendable {
2929
/// The logging key used for logging an error.
3030
public var errorKey = "error"
3131

32-
/// Initializes a new ``ServiceRunnerConfiguration/LoggingConfiguration-swift.struct``.
32+
/// Initializes a new ``ServiceRunnerConfiguration/LoggingConfiguration``.
3333
public init() {}
3434
}
3535

0 commit comments

Comments
 (0)