A SocketSubscriber uses a socket transport to handle events and should use _emit to manage the events.

  • A sub-class MUST call the _start() method once connected
  • A sub-class MUST override the _write(string) method
  • A sub-class MUST call _processMessage(string) for each message

Extended by

Implements

Constructors

new SocketSubscriber()

new SocketSubscriber(
   provider, 
   filter, 
   zone): SocketSubscriber

Creates a new SocketSubscriber attached to provider listening to filter.

Parameters

ParameterTypeDescription
providerSocketProviderThe socket provider.
filterany[]The filter.
zoneZone-

Returns

SocketSubscriber

Source

providers/provider-socket.ts:63

Accessors

filter

get filter(): any[]

The filter.

Returns

any[]

Source

providers/provider-socket.ts:46

Methods

_emit()

_emit(provider, message): Promise<void>

Sub-classes must override this to emit the events on the provider.

Parameters

ParameterTypeDescription
providerSocketProviderThe socket provider.
messageanyThe message to emit.

Returns

Promise<void>

Abstract

Source

providers/provider-socket.ts:151


pause()

pause(dropWhilePaused?): void

Pause the subscriber.

Parameters

ParameterTypeDescription
dropWhilePaused?booleanWhether to drop logs while paused.

Returns

void

Implementation of

Subscriber.pause

Source

providers/provider-socket.ts:98


resume()

resume(): void

Resume the subscriber.

Returns

void

Implementation of

Subscriber.resume

Source

providers/provider-socket.ts:111


start()

start(): void

Start the subscriber.

Returns

void

Implementation of

Subscriber.start

Source

providers/provider-socket.ts:76


stop()

stop(): void

Stop the subscriber.

Returns

void

Implementation of

Subscriber.stop

Source

providers/provider-socket.ts:86