Table of Contents

Class EventHub

Namespace
JD.AI.Gateway.Hubs
Assembly
JD.AI.Gateway.dll

Broadcasts gateway events to connected clients in real-time.

public sealed class EventHub : Hub, IDisposable
Inheritance
EventHub
Implements
Inherited Members

Constructors

EventHub(IEventBus)

public EventHub(IEventBus eventBus)

Parameters

eventBus IEventBus

Methods

OnConnectedAsync()

Called when a new connection is established with the hub.

public override Task OnConnectedAsync()

Returns

Task

A Task that represents the asynchronous connect.

StreamEvents(string?, CancellationToken)

Streams all gateway events (or filtered by type) to the client.

public IAsyncEnumerable<GatewayEvent> StreamEvents(string? eventTypeFilter = null, CancellationToken ct = default)

Parameters

eventTypeFilter string
ct CancellationToken

Returns

IAsyncEnumerable<GatewayEvent>