Table of Contents

Struct DatabaseLockFile.LockInfo

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Who holds a database, and whether they are willing to step aside.

public readonly struct DatabaseLockFile.LockInfo : IEquatable<DatabaseLockFile.LockInfo>
Implements
Inherited Members

Remarks

Why the profiler endpoint rides here. An observer that has the database — the Workbench opening a bundle its holder is using — knows who holds it but not where to watch it. The holder knows its own live port. This file is the one thing they already share, so the link is drawn database → engine, which is the direction the user arrives from. Putting the database's identity on the profiler's wire instead would answer the same question backwards, and would cost a wire-format change.

It is an advertisement of intent, not a liveness proof: the lock is written when the database opens, which may precede the listener actually binding. A consumer must treat a refused connect as "not watchable right now" rather than as a contradiction.

Constructors

LockInfo(int, string, DateTimeOffset, bool, string)

Who holds a database, and whether they are willing to step aside.

public LockInfo(int Pid, string MachineName, DateTimeOffset StartedAt, bool Yieldable, string ProfilerEndpoint)

Parameters

Pid int

Process id of the holder.

MachineName string

Machine the holder runs on. A different machine cannot be probed for liveness.

StartedAt DateTimeOffset

When the holder acquired the database.

Yieldable bool

true only when the holder explicitly advertised it. Absent means false, so a lock written by an older build — or by any normal engine — is never mistaken for one that will release on request.

ProfilerEndpoint string

Where the holder's live profiler can be reached (host:port), or null when it runs without one. Absent means null, on the same reasoning as Yieldable: a lock from an older build must never be read as offering something it does not have.

Remarks

Why the profiler endpoint rides here. An observer that has the database — the Workbench opening a bundle its holder is using — knows who holds it but not where to watch it. The holder knows its own live port. This file is the one thing they already share, so the link is drawn database → engine, which is the direction the user arrives from. Putting the database's identity on the profiler's wire instead would answer the same question backwards, and would cost a wire-format change.

It is an advertisement of intent, not a liveness proof: the lock is written when the database opens, which may precede the listener actually binding. A consumer must treat a refused connect as "not watchable right now" rather than as a contradiction.

Properties

MachineName

Machine the holder runs on. A different machine cannot be probed for liveness.

public string MachineName { get; init; }

Property Value

string

Pid

Process id of the holder.

public int Pid { get; init; }

Property Value

int

ProfilerEndpoint

Where the holder's live profiler can be reached (host:port), or null when it runs without one. Absent means null, on the same reasoning as Yieldable: a lock from an older build must never be read as offering something it does not have.

public string ProfilerEndpoint { get; init; }

Property Value

string

StartedAt

When the holder acquired the database.

public DateTimeOffset StartedAt { get; init; }

Property Value

DateTimeOffset

Yieldable

true only when the holder explicitly advertised it. Absent means false, so a lock written by an older build — or by any normal engine — is never mistaken for one that will release on request.

public bool Yieldable { get; init; }

Property Value

bool

Methods

Deconstruct(out int, out string, out DateTimeOffset, out bool, out string)

public void Deconstruct(out int Pid, out string MachineName, out DateTimeOffset StartedAt, out bool Yieldable, out string ProfilerEndpoint)

Parameters

Pid int
MachineName string
StartedAt DateTimeOffset
Yieldable bool
ProfilerEndpoint string

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(LockInfo)

public bool Equals(DatabaseLockFile.LockInfo other)

Parameters

other DatabaseLockFile.LockInfo

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(LockInfo, LockInfo)

public static bool operator ==(DatabaseLockFile.LockInfo left, DatabaseLockFile.LockInfo right)

Parameters

left DatabaseLockFile.LockInfo
right DatabaseLockFile.LockInfo

Returns

bool

operator !=(LockInfo, LockInfo)

public static bool operator !=(DatabaseLockFile.LockInfo left, DatabaseLockFile.LockInfo right)

Parameters

left DatabaseLockFile.LockInfo
right DatabaseLockFile.LockInfo

Returns

bool