@@ -24,14 +24,14 @@ protocol LifecycleWatch: DistributedActor where ActorSystem == FakeRoundtripActo
2424}
2525
2626extension LifecycleWatch {
27- func watch( ) async throws {
27+ func watch< T : Codable > ( x : Int , _ y : T ) async throws {
2828 // nothing here
29- print ( " executed: \( #function) " )
29+ print ( " executed: \( #function) - x = \( x ) , y = \( y ) " )
3030 }
3131
32- distributed func test( ) async throws {
32+ distributed func test< T : Codable > ( x : Int , _ y : T ) async throws {
3333 print ( " executed: \( #function) " )
34- try await self . watch ( )
34+ try await self . watch ( x : x , y )
3535 print ( " done executed: \( #function) " )
3636 }
3737}
@@ -42,11 +42,11 @@ distributed actor Worker: LifecycleWatch {
4242@main struct Main {
4343 static func main( ) async {
4444 let worker : any LifecycleWatch = Worker ( actorSystem: DefaultDistributedActorSystem ( ) )
45- try ! await worker. test ( )
45+ try ! await worker. test ( x : 42 , " on protocol " )
4646
47- // CHECK: executed: test()
48- // CHECK: executed: watch()
49- // CHECK: done executed: test()
47+ // CHECK: executed: test(x:_: )
48+ // CHECK: executed: watch(x:_:) - x = 42, y = on protocol
49+ // CHECK: done executed: test(x:_: )
5050
5151 print ( " OK " ) // CHECK: OK
5252 }
0 commit comments