1+ //===----------------------------------------------------------------------===//
2+ //
3+ // This source file is part of the SwiftServiceLifecycle open source project
4+ //
5+ // Copyright (c) 2023 Apple Inc. and the SwiftServiceLifecycle project authors
6+ // Licensed under Apache License v2.0
7+ //
8+ // See LICENSE.txt for license information
9+ // See CONTRIBUTORS.txt for the list of SwiftServiceLifecycle project authors
10+ //
11+ // SPDX-License-Identifier: Apache-2.0
12+ //
13+ //===----------------------------------------------------------------------===//
14+
115import ServiceLifecycle
216
317actor MockService : Service , CustomStringConvertible {
@@ -9,7 +23,7 @@ actor MockService: Service, CustomStringConvertible {
923 }
1024
1125 let events : AsyncStream < Event >
12- internal private( set) var hasRun : Bool = false
26+ private( set) var hasRun : Bool = false
1327
1428 private let eventsContinuation : AsyncStream < Event > . Continuation
1529
@@ -24,18 +38,18 @@ actor MockService: Service, CustomStringConvertible {
2438 description: String
2539 ) {
2640 var eventsContinuation : AsyncStream < Event > . Continuation !
27- self . events = AsyncStream< Event> { eventsContinuation = $0 }
41+ events = AsyncStream< Event> { eventsContinuation = $0 }
2842 self . eventsContinuation = eventsContinuation!
2943
3044 var pingContinuation : AsyncStream < Void > . Continuation !
31- self . pings = AsyncStream< Void> { pingContinuation = $0 }
45+ pings = AsyncStream< Void> { pingContinuation = $0 }
3246 self . pingContinuation = pingContinuation!
3347
3448 self . description = description
3549 }
3650
3751 func run( ) async throws {
38- self . hasRun = true
52+ hasRun = true
3953
4054 try await withTaskCancellationHandler {
4155 try await withGracefulShutdownHandler {
@@ -62,10 +76,10 @@ actor MockService: Service, CustomStringConvertible {
6276 }
6377
6478 func resumeRunContinuation( with result: Result < Void , Error > ) {
65- self . runContinuation? . resume ( with: result)
79+ runContinuation? . resume ( with: result)
6680 }
6781
6882 nonisolated func sendPing( ) {
69- self . pingContinuation. yield ( )
83+ pingContinuation. yield ( )
7084 }
7185}
0 commit comments