Class FederationSender
Sends new room events to the other servers in each room as transactions: events of local users, and joins of remote users that this server accepted as the room's server; and device changes and presence of local users as m.device_list_update and m.presence EDUs.
Inherited Members
Namespace: Uniform.Matrix.Server.Federation
Assembly: Uniform.Matrix.Server.dll
Syntax
public sealed class FederationSender : BackgroundService, IHostedService, IDisposable
Remarks
Follows the ServerStream like PushNotifier and hands what it finds to the FederationQueue, which batches and retries. Its position is kept in FederationProgressRow, so after a restart it continues where it stopped; on the first start it begins with new events.
Constructors
| Edit this page View SourceFederationSender(IDbContextFactory<ServerDbContext>, ServerStream, FederationQueue, PresenceService, IOptionsMonitor<ServerOptions>, IOptionsMonitor<FederationOptions>, TimeProvider, ILogger<FederationSender>)
Create the sender.
Declaration
public FederationSender(IDbContextFactory<ServerDbContext> contexts, ServerStream stream, FederationQueue queue, PresenceService presence, IOptionsMonitor<ServerOptions> server, IOptionsMonitor<FederationOptions> options, TimeProvider time, ILogger<FederationSender> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IDbContextFactory<ServerDbContext> | contexts | |
| ServerStream | stream | |
| FederationQueue | queue | |
| PresenceService | presence | |
| IOptionsMonitor<ServerOptions> | server | |
| IOptionsMonitor<FederationOptions> | options | |
| TimeProvider | time | |
| ILogger<FederationSender> | logger |
Methods
| Edit this page View SourceExecuteAsync(CancellationToken)
Follow the stream until the server stops, sending the events of each new position.
Declaration
protected override Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | stoppingToken |
Returns
| Type | Description |
|---|---|
| Task |