Table of Contents

Class CharacterWriteAdmission

Namespace
FishMMO.Database.Npgsql.Services
Assembly
FishMMO-DB.dll

The characters one gated write may touch, decided inside the write's own transaction.

public sealed class CharacterWriteAdmission
Inheritance
CharacterWriteAdmission
Inherited Members

Remarks

For an owned write every character in Writable is held under a share lock until the transaction ends, so nothing that changes its claim — a release, a claim, the row save, the lease refresh — can commit in between: the decision stays true for as long as the rows it admitted are being written.

Properties

Unowned

Live characters whose rows are refused because the writer does not hold their claim.

public IReadOnlyCollection<long> Unowned { get; }

Property Value

IReadOnlyCollection<long>

Writable

Characters whose rows may be written.

public IReadOnlyCollection<long> Writable { get; }

Property Value

IReadOnlyCollection<long>

Methods

Admits(long)

Whether a row of this character may be written.

public bool Admits(long characterId)

Parameters

characterId long

Returns

bool

CountUnowned<T>(IEnumerable<T>, Func<T, long>)

How many of rows belong to a character refused for want of its claim.

public int CountUnowned<T>(IEnumerable<T> rows, Func<T, long> characterOf)

Parameters

rows IEnumerable<T>
characterOf Func<T, long>

Returns

int

Type Parameters

T