Class DelayedEvents
Delayed events (MSC4140): events sent later unless restarted or cancelled first, which MatrixRTC uses to end the call membership of a client that disappears.
Inheritance
DelayedEvents
Namespace: Uniform.Matrix.Server.Rooms
Assembly: Uniform.Matrix.Server.dll
public sealed class DelayedEvents : IHostedService, IDisposable
Constructors
|
Edit this page
View Source
DelayedEvents(RoomService, IOptionsMonitor<CallOptions>, TimeProvider, ILogger<DelayedEvents>, IDbContextFactory<ServerDbContext>)
Declaration
public DelayedEvents(RoomService rooms, IOptionsMonitor<CallOptions> options, TimeProvider time, ILogger<DelayedEvents> logger, IDbContextFactory<ServerDbContext> contexts)
Parameters
Methods
|
Edit this page
View Source
Restart, cancel or send now (action restart, cancel or send) a delayed event; throw M_NOT_FOUND when there is none, e.g. as it was sent already.
Declaration
public Task ActAsync(string delayId, string action, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Declaration
|
Edit this page
View Source
Return the user's delayed events as MSC4140 lists them.
Declaration
public JsonArray List(string userId)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
Returns
|
Edit this page
View Source
ScheduleAsync(Requester, string, string, string?, JsonObject, long, CancellationToken)
Schedule a message (stateKey null) or state event; return its delay ID.
Declaration
public Task<string> ScheduleAsync(Requester requester, string roomId, string type, string? stateKey, JsonObject content, long delayMilliseconds, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Load the delayed events kept from before a restart, after the database is migrated: send those whose delay ran out, and wait for the rest of the others' delays.
Declaration
public Task StartAsync(CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Leave the kept delayed events for the next start.
Declaration
public Task StopAsync(CancellationToken cancellationToken)
Parameters
Returns
Implements