Skip to content

PURISTA API / Modules / @purista/core / EventBridgeBaseClass

Class: EventBridgeBaseClass<ConfigType>

@purista/core.EventBridgeBaseClass

The base class to be extended by event bridge implementations

Type parameters

Name
ConfigType

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EventBridgeBaseClass<ConfigType>(name, config): EventBridgeBaseClass<ConfigType>

Type parameters

Name
ConfigType

Parameters

NameType
namestring
config{ [K in string | number | symbol]: (Object & ConfigType)[K] }

Returns

EventBridgeBaseClass<ConfigType>

Overrides

GenericEventEmitter.constructor

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:30

Properties

config

config: Complete<{ [K in string | number | symbol]: (Object & ConfigType)[K] }>

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:23


defaultCommandTimeout

defaultCommandTimeout: number

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:29


instanceId

instanceId: string

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:27


logger

logger: Logger

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:20


name

name: string

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:25


traceProvider

traceProvider: NodeTracerProvider

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:21

Methods

destroy

destroy(): Promise<void>

Returns

Promise<void>

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:155


emit

emit<K>(eventName, parameter?): void

Type parameters

NameType
Kextends EventKey<{ eventbridge-connected: never ; eventbridge-connection-error: unknown ; eventbridge-disconnected: never ; eventbridge-error: unknown ; eventbridge-reconnecting: never }>

Parameters

NameType
eventNameK
parameter?{ eventbridge-connected: never ; eventbridge-connection-error: unknown ; eventbridge-disconnected: never ; eventbridge-error: unknown ; eventbridge-reconnecting: never }[K]

Returns

void

Inherited from

GenericEventEmitter.emit

Defined in

core/types/GenericEventEmitter.ts:24


getTracer

getTracer(): Tracer

Returns open telemetry tracer of this service

Returns

Tracer

Tracer

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:70


off

off<K>(eventName, fn): void

Type parameters

NameType
Kextends EventKey<{ eventbridge-connected: never ; eventbridge-connection-error: unknown ; eventbridge-disconnected: never ; eventbridge-error: unknown ; eventbridge-reconnecting: never }>

Parameters

NameType
eventNameK
fnEventReceiver<{ eventbridge-connected: never ; eventbridge-connection-error: unknown ; eventbridge-disconnected: never ; eventbridge-error: unknown ; eventbridge-reconnecting: never }[K]>

Returns

void

Inherited from

GenericEventEmitter.off

Defined in

core/types/GenericEventEmitter.ts:20


on

on<K>(eventName, fn): void

Type parameters

NameType
Kextends EventKey<{ eventbridge-connected: never ; eventbridge-connection-error: unknown ; eventbridge-disconnected: never ; eventbridge-error: unknown ; eventbridge-reconnecting: never }>

Parameters

NameType
eventNameK
fnEventReceiver<{ eventbridge-connected: never ; eventbridge-connection-error: unknown ; eventbridge-disconnected: never ; eventbridge-error: unknown ; eventbridge-reconnecting: never }[K]>

Returns

void

Inherited from

GenericEventEmitter.on

Defined in

core/types/GenericEventEmitter.ts:16


removeAllListeners

removeAllListeners(): void

Returns

void

Inherited from

GenericEventEmitter.removeAllListeners

Defined in

core/types/GenericEventEmitter.ts:28


start

start(): Promise<void>

Returns

Promise<void>

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:156


startActiveSpan

startActiveSpan<F>(name, opts, context?, fn): Promise<F>

Start a child span for opentelemetry tracking

Type parameters

Name
F

Parameters

NameTypeDefault valueDescription
namestringundefinedname of span
optsSpanOptionsundefinedspan options
contextundefined | Contextundefinedoptional context
fn(span: Span) => Promise<F>undefinedfunction to be executed within the span

Returns

Promise<F>

return value of fn

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:82


wrapInSpan

wrapInSpan<F>(name, opts, fn, context?): Promise<F>

Start span for opentelemetry tracking on same level. The created span will not become the "active" span within opentelemetry!

This means during logging and similar the spanId of parent span is logged.

Use wrapInSpan for marking points in flow of one bigger function, but not to trace the program flow itself

Type parameters

Name
F

Parameters

NameTypeDescription
namestringname of span
optsSpanOptionsspan options
fn(span: Span) => Promise<F>function te be executed in the span
context?Contextspan context

Returns

Promise<F>

return value of fn

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:132