Skip to content

Commit ea92b45

Browse files
committed
Rename ClusterEventStreamShell to ClusterEventStreamActor
1 parent 97df694 commit ea92b45

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Sources/DistributedActors/Cluster/ClusterEventStream.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,60 @@ import Logging
2323
public struct ClusterEventStream: AsyncSequence {
2424
public typealias Element = Cluster.Event
2525

26-
private let shell: ClusterEventStreamShell?
26+
private let actor: ClusterEventStreamActor?
2727

2828
internal init(_ system: ClusterSystem, customName: String? = nil) {
29-
var props = ClusterEventStreamShell.props
29+
var props = ClusterEventStreamActor.props
3030
if let customName = customName {
3131
props._knownActorName = customName
3232
}
3333

34-
self.shell = _Props.$forSpawn.withValue(props) {
35-
ClusterEventStreamShell(actorSystem: system)
34+
self.actor = _Props.$forSpawn.withValue(props) {
35+
ClusterEventStreamActor(actorSystem: system)
3636
}
3737
}
3838

3939
// For testing only
4040
internal init() {
41-
self.shell = nil
41+
self.actor = nil
4242
}
4343

4444
func subscribe(_ ref: _ActorRef<Cluster.Event>, file: String = #filePath, line: UInt = #line) async {
45-
guard let shell = self.shell else { return }
45+
guard let actor = self.actor else { return }
4646

47-
await shell.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
47+
await actor.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
4848
__secretlyKnownToBeLocal.subscribe(ref)
4949
}
5050
}
5151

5252
func unsubscribe(_ ref: _ActorRef<Cluster.Event>, file: String = #filePath, line: UInt = #line) async {
53-
guard let shell = self.shell else { return }
53+
guard let actor = self.actor else { return }
5454

55-
await shell.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
55+
await actor.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
5656
__secretlyKnownToBeLocal.unsubscribe(ref)
5757
}
5858
}
5959

6060
private func subscribe(_ oid: ObjectIdentifier, eventHandler: @escaping (Cluster.Event) -> Void) async {
61-
guard let shell = self.shell else { return }
61+
guard let actor = self.actor else { return }
6262

63-
await shell.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
63+
await actor.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
6464
__secretlyKnownToBeLocal.subscribe(oid, eventHandler: eventHandler)
6565
}
6666
}
6767

6868
private func unsubscribe(_ oid: ObjectIdentifier) async {
69-
guard let shell = self.shell else { return }
69+
guard let actor = self.actor else { return }
7070

71-
await shell.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
71+
await actor.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
7272
__secretlyKnownToBeLocal.unsubscribe(oid)
7373
}
7474
}
7575

7676
func publish(_ event: Cluster.Event, file: String = #filePath, line: UInt = #line) async {
77-
guard let shell = self.shell else { return }
77+
guard let actor = self.actor else { return }
7878

79-
await shell.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
79+
await actor.whenLocal { __secretlyKnownToBeLocal in // TODO(distributed): this is annoying, we must track "known to be local" in typesystem instead
8080
__secretlyKnownToBeLocal.publish(event)
8181
}
8282
}
@@ -112,7 +112,7 @@ public struct ClusterEventStream: AsyncSequence {
112112
}
113113

114114
// FIXME(distributed): the only reason this actor is distributed is because of LifecycleWatch
115-
internal distributed actor ClusterEventStreamShell: LifecycleWatch {
115+
internal distributed actor ClusterEventStreamActor: LifecycleWatch {
116116
typealias ActorSystem = ClusterSystem
117117

118118
static var props: _Props {

0 commit comments

Comments
 (0)