Class RealtimeSession
public sealed class RealtimeSession : IDisposable
- Inheritance
-
RealtimeSession
- Implements
- Inherited Members
Properties
Configuration
The configuration options for the session.
public SessionConfiguration Configuration { get; }
Property Value
EnableDebug
Enable or disable logging.
public bool EnableDebug { get; set; }
Property Value
EventTimeout
The timeout in seconds to wait for a response from the server.
public int EventTimeout { get; set; }
Property Value
Options
[Obsolete("Use RealtimeSession.Configuration")]
public SessionConfiguration Options { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~RealtimeSession()
protected ~RealtimeSession()
ReceiveUpdatesAsync<T>(Action<T>, CancellationToken)
Receive callback updates from the server
public Task ReceiveUpdatesAsync<T>(Action<T> sessionEvent, CancellationToken cancellationToken) where T : IRealtimeEvent
Parameters
sessionEvent
Action<T>The event to receive updates for.
cancellationToken
CancellationTokenOptional, CancellationToken.
Returns
Type Parameters
T
IRealtimeEvent to subscribe for updates to.
Exceptions
- Exception
If ReceiveUpdatesAsync<T>(CancellationToken) is already running.
ReceiveUpdatesAsync<T>(CancellationToken)
Receive callback updates from the server
public IAsyncEnumerable<T> ReceiveUpdatesAsync<T>(CancellationToken cancellationToken) where T : IRealtimeEvent
Parameters
cancellationToken
CancellationTokenOptional, CancellationToken.
Returns
Type Parameters
T
IRealtimeEvent to subscribe for updates to.
Exceptions
- Exception
If ReceiveUpdatesAsync<T>(CancellationToken) is already running.
SendAsync<T>(T, Action<IServerEvent>, CancellationToken)
Send a client event to the server.
public Task<IServerEvent> SendAsync<T>(T @event, Action<IServerEvent> sessionEvents, CancellationToken cancellationToken = default) where T : IClientEvent
Parameters
event
TThe event to send.
sessionEvents
Action<IServerEvent>Optional, Action<T>.
cancellationToken
CancellationTokenOptional, CancellationToken.
Returns
Type Parameters
T
IClientEvent to send to the server.
SendAsync<T>(T, CancellationToken)
Send a client event to the server.
public Task<IServerEvent> SendAsync<T>(T @event, CancellationToken cancellationToken = default) where T : IClientEvent
Parameters
event
TThe event to send.
cancellationToken
CancellationTokenOptional, CancellationToken.
Returns
Type Parameters
T
IClientEvent to send to the server.
Send<T>(T)
Send a client event to the server.
public void Send<T>(T @event) where T : IClientEvent
Parameters
event
TThe event to send.
Type Parameters
T
IClientEvent to send to the server.