Table of Contents

Class GlowSignalRClient

Namespace
Phoesion.Glow.SDK.Client.SignalR
Assembly
Phoesion.Glow.SDK.Client.SignalR.dll
public class GlowSignalRClient : IGlowSignalRClient, IGlowClient, IDisposable
Inheritance
object
GlowSignalRClient
Implements

Constructors

GlowSignalRClient(IOptions<GlowSignalRClientOptions>, ILogger<GlowSignalRClient>)

public GlowSignalRClient(IOptions<GlowSignalRClientOptions> options, ILogger<GlowSignalRClient> logger)

Parameters

options IOptions<GlowSignalRClientOptions>
logger ILogger<GlowSignalRClient>

Fields

Options

public readonly GlowSignalRClientOptions Options

Field Value

GlowSignalRClientOptions

Registration

public Func<GlowSignalRClient, CancellationToken, Task>? Registration

Field Value

Func<GlowSignalRClient, CancellationToken, Task>

ServerUrl

public readonly string ServerUrl

Field Value

string

Properties

IsConnected

public bool IsConnected { get; }

Property Value

bool

IsDisposed

public bool IsDisposed { get; }

Property Value

bool

IsOpen

public bool IsOpen { get; }

Property Value

bool

IsRegistered

public bool IsRegistered { get; }

Property Value

bool

IsStarted

public bool IsStarted { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

On<TMsg>(PushTopic<TMsg>, Action<TMsg>)

Register a handler callback to receive incoming messages on specified topic

public IDisposable On<TMsg>(PushTopic<TMsg> Topic, Action<TMsg> Handler) where TMsg : class

Parameters

Topic PushTopic<TMsg>

The topic to register for listening

Handler Action<TMsg>

The handler action that will process incoming messages

Returns

IDisposable

Type Parameters

TMsg

On<TMsg>(PushTopic<TMsg>, Func<TMsg, Task>)

Register a handler callback to receive incoming messages on specified topic

public IDisposable On<TMsg>(PushTopic<TMsg> Topic, Func<TMsg, Task> Handler) where TMsg : class

Parameters

Topic PushTopic<TMsg>

The topic to register for listening

Handler Func<TMsg, Task>

The handler action that will process incoming messages

Returns

IDisposable

Type Parameters

TMsg

On<TRequest, TResponse>(PushTopic<TRequest, TResponse>, Func<TRequest, IRequestHandlerContext, Task<TResponse>>)

Register an RPC handler to receive incoming requests on specified topic

public IDisposable On<TRequest, TResponse>(PushTopic<TRequest, TResponse> Topic, Func<TRequest, IRequestHandlerContext, Task<TResponse>> Handler) where TRequest : class where TResponse : class

Parameters

Topic PushTopic<TRequest, TResponse>

The topic to register for listening

Handler Func<TRequest, IRequestHandlerContext, Task<TResponse>>

The handler action that will process incoming requests

Returns

IDisposable

Type Parameters

TRequest
TResponse

On<TRequest, TResponse>(PushTopic<TRequest, TResponse>, Func<TRequest, IRequestHandlerContext, TResponse>)

Register an RPC handler to receive incoming requests on specified topic

public IDisposable On<TRequest, TResponse>(PushTopic<TRequest, TResponse> Topic, Func<TRequest, IRequestHandlerContext, TResponse> Handler) where TRequest : class where TResponse : class

Parameters

Topic PushTopic<TRequest, TResponse>

The topic to register for listening

Handler Func<TRequest, IRequestHandlerContext, TResponse>

The handler action that will process incoming requests

Returns

IDisposable

Type Parameters

TRequest
TResponse

RegisterAsync<TReq, TResp>(Func<TReq, TResp>, TReq, CancellationToken, TimeSpan?, TResp?)

public Task<TResp?> RegisterAsync<TReq, TResp>(Func<TReq, TResp> RegistationAction, TReq Request, CancellationToken cancellationToken, TimeSpan? Timeout = null, TResp? Default = default)

Parameters

RegistationAction Func<TReq, TResp>
Request TReq
cancellationToken CancellationToken
Timeout TimeSpan?
Default TResp

Returns

Task<TResp>

Type Parameters

TReq
TResp

StartAsync(CancellationToken)

public Task StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

StopAsync(CancellationToken)

public Task StopAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

Events

Closed

public event GlowSignalRClient.ClosedDelegate? Closed

Event Type

GlowSignalRClient.ClosedDelegate

Disconnected

public event GlowSignalRClient.DisconnectedDelegate? Disconnected

Event Type

GlowSignalRClient.DisconnectedDelegate

Opened

public event GlowSignalRClient.OpenedDelegate? Opened

Event Type

GlowSignalRClient.OpenedDelegate

Reconnected

public event GlowSignalRClient.ReconnectedDelegate? Reconnected

Event Type

GlowSignalRClient.ReconnectedDelegate

Reconnecting

public event GlowSignalRClient.ReconnectingDelegate? Reconnecting

Event Type

GlowSignalRClient.ReconnectingDelegate