Home Reference Source Test
public class | source

Subscription

Extends:

events~EventEmitter → Subscription

Constructor Summary

Public Constructor
public

Creates an instance of subscription.

Member Summary

Public Members
public get

Gets get credentials

public get

Returns subscriptionId

public

indicates if subscription is running

public

logger

public get

Returns subscription nam

Protected Members
protected

credentials for subscription

protected

global log position

protected

indicates if events should be full resolved

protected

instance of corresponding stream

protected

uuid4 of subscription

protected

connection to use

Method Summary

Public Methods
public

eventAppeared(event: Event, position: Position): void

Called when event from eventstore arrives

public

Gets resolve link tos

public

async unsubscribe(): Promise

Unsubscribe from stream

Protected Methods
protected

onDropped(reason: ): void

Called when subscription was dropped

protected

onError(err: Error): void

Called when error appears

protected

onEvent(event: Event, position: Position): void

Determines whether event on

protected

onSubscribed(): void

Called when subscription is established

Public Constructors

public constructor() source

Creates an instance of subscription.

Public Members

public get getCredentials: UserCredentials | null source

Gets get credentials

public get id: string source

Returns subscriptionId

public isSubscribed: boolean source

indicates if subscription is running

public log: bunyan source

logger

public get name: string source

Returns subscription nam

Protected Members

protected credentials: UserCredentials | null source

credentials for subscription

protected position: Position | null source

global log position

protected resolveLinkTos: boolean source

indicates if events should be full resolved

protected stream: Stream source

instance of corresponding stream

protected subscriptionId: string source

uuid4 of subscription

protected tcpConnection: TCPConnection source

connection to use

Public Methods

public eventAppeared(event: Event, position: Position): void source

Called when event from eventstore arrives

Params:

NameTypeAttributeDescription
event Event
position Position

public getResolveLinkTos(): boolean source

Gets resolve link tos

public async unsubscribe(): Promise source

Unsubscribe from stream

Protected Methods

protected onDropped(reason: ): void source

Called when subscription was dropped

Params:

NameTypeAttributeDescription
reason

protected onError(err: Error): void source

Called when error appears

Params:

NameTypeAttributeDescription
err Error

protected onEvent(event: Event, position: Position): void source

Determines whether event on

Params:

NameTypeAttributeDescription
event Event
position Position

protected onSubscribed(): void source

Called when subscription is established