Vixen
c7401864
csharp
public interface IQueueGrain

One queue's tickets and the matches it has formed. Doc 28 § Matchmaking.

Read the guide page for this →

Remarks

The last of the three doc 27 left undeclared at L1, and doc 28 is specific about the shape: a ticket is "a grain-held record". Vixen.Live.Matchmaking's Matchmaker is an in-memory queue, which is the first item on its own owed list.

⚠ The scoring stays a pure function and the grain is a scheduling decision on top. That is exactly the relationship PlacementDirector has to IMapGrain, and it is what lets doc 27 § Testing's property tests run tens of thousands of randomised fleets — a matchmaker that could only be exercised inside a silo is one nobody tests.

⚠ Formed is not started. A roster still needs a shard, and allocating one can fail, so the tickets are held rather than released and the caller either Starts or Abandons. L2's reservation, at a different scale and for the same reason.

⚠ Keyed by the queue definition's address, so "the ranked 3v3 queue" is one grain per region-and-version the caller decides to spell into the key — the same freedom ShardKey gives a map.

Methods (8)

  • Task<QueueTicket> Enqueue(QueueEntry entry)

    Joins the queue.

  • Task<bool> Cancel(string ticket)

    Gives up.

  • Task<QueueTicket?> Ticket(string ticket)

    Where a ticket has got to.

  • Task<ImmutableArray<QueueMatch>> Cycle(DateTimeOffset now)

    Forms whatever can be formed.

  • Task<bool> Start(Guid match)

    Says a formed match got its shard.

  • Task<bool> Abandon(Guid match, DateTimeOffset now)

    Says a formed match did not get one, and puts its tickets back.

  • Task<bool> Backfill(Guid match, int seats)

    Says somebody left a running match, so a seat needs filling.

  • Task<QueueSnapshot> Read()

    What the queue looks like.

Used by (1)

  • QueueGrainVixen.Live.Orchestrator