apple / swift-distributed-actors

Peer-to-peer cluster implementation for Swift Distributed Actors

Home Page:https://apple.github.io/swift-distributed-actors/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reception.Key's ID should not be string, but a type

ktoso opened this issue · comments

Then we can avoid this:

distributed actor VegetableChopper: Chopping {

  @ActorID.Metadata(\.receptionID)
  var receptionID: String

  init(actorSystem: ActorSystem) async {
    self.actorSystem = actorSystem

    self.receptionID = "*" // default key for "all of this type"
  }
}

and we can do instead:

    self.receptionID = .default // default key for "all of this type"