Class PlotUpdateService
Records when plots change, so scene servers hosting other channels can notice.
public sealed class PlotUpdateService : BaseService<PlotUpdateEntity>, IPlotUpdateService
- Inheritance
-
PlotUpdateService
- Implements
- Inherited Members
Remarks
The same polling shape guilds use, for the same reason: a plot is visible from every scene server hosting a channel of its scene, and the server that processed a claim is not the one that has to redraw the foundation everywhere else.
Constructors
PlotUpdateService(INpgsqlDbContextFactory)
public PlotUpdateService(INpgsqlDbContextFactory dbContextFactory)
Parameters
dbContextFactoryINpgsqlDbContextFactory
Methods
DeleteAsync(long, CancellationToken)
Removes the update record for a plot.
public Task<DatabaseResult<int>> DeleteAsync(long plotID, CancellationToken cancellationToken = default)
Parameters
plotIDlongcancellationTokenCancellationToken
Returns
FetchAsync(List<long>, DateTime, CancellationToken)
Fetches the plots among plotIDs that changed at or after lastFetch.
public Task<DatabaseResult<List<PlotUpdateData>>> FetchAsync(List<long> plotIDs, DateTime lastFetch, CancellationToken cancellationToken = default)
Parameters
plotIDsList<long>lastFetchDateTimecancellationTokenCancellationToken
Returns
PersistAsync(long, CancellationToken)
Marks a plot as changed as of now.
public Task<DatabaseResult> PersistAsync(long plotID, CancellationToken cancellationToken = default)
Parameters
plotIDlongcancellationTokenCancellationToken