Vixen
02b45cc4
csharp
public interface IMapGrain

One map's shards: who goes where, and when the map grows or shrinks.

Read the guide page for this →

Remarks

Keyed by ForMap — the map address, the region and the version pair, because two shards are only interchangeable when all three agree and a grain that spanned versions would be answering for two fleets at once during every rollout.

⚠ Single-threaded by construction, which is the correctness property rather than a performance one. Two players zoning in at the same instant are two turns of the same grain, so the fleet cannot decide twice that it is short of capacity — which is doc 27's named twenty-shards failure expressed as a scheduling guarantee instead of a lock.

Methods (5)

  • Task<PlaceResult> Place(PlaceRequest request)

    Puts a player somewhere, or says a shard is on its way.

  • Task<ShardReport[]> Shards()

    Every shard of this map, in any state.

  • Task ShardChanged(ShardReport report)

    Told by a shard when its state changes, so the map does not have to poll.

  • Task PlayerLeft(PlayerKey player, ShardId shard)

    Told when a player leaves a shard, so the affinity counts stay honest.

  • Task<string> Tick(DateTimeOffset now)

    One turn of the spawn and merge heuristics.

Used by (7)

  • ClusterFleetDirectoryVixen.Live.Gate
  • ClusterGrainsVixen.Live.Realm.Cluster
  • FakeClusterVixen.Live.Realm.Cluster.Tests
  • FakeMapVixen.Live.Realm.Cluster.Tests
  • IRealmGrainsVixen.Live.Realm.Cluster
  • MapGrainVixen.Live.Orchestrator
  • RealmClusterVixen.Live.Realm.Cluster