Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RealtimeCommunicator

The realtime communicator handles the SignalR hubs and their connections

export

Hierarchy

  • RealtimeCommunicator

Index

Constructors

constructor

  • Creates an instance of RealtimeCommunicator The realtime communicator uses SignalR to connect to a number of hubs supplied by EVA. The getApplicationConfiguration response will contain the required urls

    memberof

    RealtimeCommunicator

    Returns RealtimeCommunicator

Properties

activity$

activity$: Subject<IConnectionActivity>

Debug-able activity stream for SignalR

connection

connection: {}

All the connection grouped by hub

memberof

RealtimeCommunicator

Type declaration

event$

event$: Subject<IHubEvent>

The combined realtime event feed from all hubs as an observable

memberof

RealtimeCommunicator

Private hubs

hubs: IEvaSignalRHub[] = []

The current list of EVA SignalR hubs

memberof

RealtimeCommunicator

peers$

peers$: Observable<IPeerClientStatus[]> = this._peers$.asObservable()

Methods

Protected buildHeaders

Protected buildQueryParams

disconnectAll

  • disconnectAll(): Promise<void>

getChannelStatus

getChannels

  • getChannels(): string[]

getPeers

joinChannel

joinClientAppHub

joinCustomerFacingDisplayHub

joinDeviceHub

joinElevationBarcodeHub

joinGlobalBlueHub

joinMagicLinkHub

joinOrderHub

joinPaymentHub

joinUserTaskHub

leaveChannel

leaveClientAppHub

leaveCustomerFacingDisplayHub

leaveDeviceHub

leaveElevationBarcodeHub

leaveGlobalBlueHub

leaveMagicLinkHub

leaveOrderHub

leavePaymentHub

leaveUserTaskHub

ping

  • ping(uuid: string): Promise<void[]>
  • Manually triggers a ping to see which other clients are currently connected to the hub

    Parameters

    • uuid: string

    Returns Promise<void[]>

purgeStalePeers

  • purgeStalePeers(): void

pushDisplayOrderToDevice

reconnect

  • reconnect(hubName?: string): Promise<undefined | void[]>
  • Force an immediate reconnection attempt. Can be useful for clients coming out of a sleep or apps being resumed. ClientApp hub is usually the one you want to immediately reconnect to

    Parameters

    • Default value hubName: string = "ClientAppHub"

    Returns Promise<undefined | void[]>

sendAppMessage

  • Push a message to all apps registered on the same hub

    memberof

    RealtimeCommunicator

    Parameters

    Returns Promise<void[]>

sendScannedBarcode

  • sendScannedBarcode(scanEvent: IHubEventBarcode, hubName?: string): Promise<void>

sendSessionToDevice

start

  • start(): Promise<void>
  • Start listening to the getApplicationConfig Will resolve its promise when first application config is received

    memberof

    RealtimeCommunicator

    Returns Promise<void>

stop

  • stop(): Promise<void>
  • Stop listening for application configuration changes and disconnect all hubs

    memberof

    RealtimeCommunicator

    Returns Promise<void>