Table of Contents

Interface IPlotUpdateService

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

Records when plots change, so scene servers hosting other channels can notice.

public interface IPlotUpdateService

Methods

DeleteAsync(long, CancellationToken)

Removes the update record for a plot.

Task<DatabaseResult<int>> DeleteAsync(long plotID, CancellationToken cancellationToken = default)

Parameters

plotID long
cancellationToken CancellationToken

Returns

Task<DatabaseResult<int>>

FetchAsync(List<long>, DateTime, CancellationToken)

Fetches the plots among plotIDs that changed at or after lastFetch, and the database time the read was taken at.

Task<DatabaseResult<PlotUpdatePollData>> FetchAsync(List<long> plotIDs, DateTime lastFetch, CancellationToken cancellationToken = default)

Parameters

plotIDs List<long>

The plots to watch. May be empty: the poll still reports its time.

lastFetch DateTime

Where the window starts, on the DATABASE clock — a previous poll's AsOfUtc, less a margin for writes committed after their stamp — or MinValue for every mark there is.

cancellationToken CancellationToken

Returns

Task<DatabaseResult<PlotUpdatePollData>>

Remarks

Marks are stamped by the database clock, so the window has to be measured on it too. A window measured on the poller's own clock lost every change stamped within however far that clock ran ahead.

PersistAsync(long, CancellationToken)

Marks a plot as changed as of now.

Task<DatabaseResult> PersistAsync(long plotID, CancellationToken cancellationToken = default)

Parameters

plotID long
cancellationToken CancellationToken

Returns

Task<DatabaseResult>