Skip to main content

Class: EventBridgeBaseClass<ConfigType>


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:28open in new window

Properties

config

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

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:21open in new window


defaultCommandTimeout

defaultCommandTimeout: number

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:27open in new window


instanceId

instanceId: string

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:25open in new window


logger

logger: Logger

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:18open in new window


name

name: string

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:23open in new window


traceProvider

traceProvider: NodeTracerProvider

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:19open in new window

Methods

destroy

destroy(): Promise<void>

Returns

Promise<void>

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:153open in new window


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:24open in new window


getTracer

getTracer(): Tracer

Returns open telemetry tracer of this service

Returns

Tracer

Tracer

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:68open in new window


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:20open in new window


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:16open in new window


removeAllListeners

removeAllListeners(): void

Returns

void

Inherited from

GenericEventEmitter.removeAllListeners

Defined in

core/types/GenericEventEmitter.ts:28open in new window


start

start(): Promise<void>

Returns

Promise<void>

Defined in

core/EventBridge/EventBridgeBaseClass.impl.ts:154open in new window


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:80open in new window


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:130open in new window

Last update:
Contributors: Sebastian Wessel