Skip to content

Commit 4eaaf07

Browse files
authored
Rename shutdownGracefully to triggerGracefulShutdown on the ServiceGroup (#142)
1 parent 7a8226c commit 4eaaf07

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/ServiceLifecycle/ServiceGroup.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public actor ServiceGroup: Sendable {
102102
/// Triggers the graceful shutdown of all services.
103103
///
104104
/// This method returns immediately after triggering the graceful shutdown and doesn't wait until the service have shutdown.
105-
public func shutdownGracefully() async {
105+
public func triggerGracefulShutdown() async {
106106
switch self.state {
107107
case .initial:
108108
// We aren't even running so we can stop right away.

Tests/ServiceLifecycleTests/ServiceGroupTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ final class ServiceGroupTests: XCTestCase {
487487
}
488488
}
489489

490-
func testShutdownGracefully() async throws {
490+
func testTriggerGracefulShutdown() async throws {
491491
let configuration = ServiceGroupConfiguration(gracefulShutdownSignals: [])
492492
let service1 = MockService(description: "Service1")
493493
let service2 = MockService(description: "Service2")
@@ -508,7 +508,7 @@ final class ServiceGroupTests: XCTestCase {
508508
var eventIterator3 = service3.events.makeAsyncIterator()
509509
await XCTAsyncAssertEqual(await eventIterator3.next(), .run)
510510

511-
await serviceGroup.shutdownGracefully()
511+
await serviceGroup.triggerGracefulShutdown()
512512

513513
// The last service should receive the shutdown signal first
514514
await XCTAsyncAssertEqual(await eventIterator3.next(), .shutdownGracefully)

0 commit comments

Comments
 (0)