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
GenericEventEmitter
<EventBridgeEvents
>↳
EventBridgeBaseClass
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new EventBridgeBaseClass<ConfigType
>(name
, config
): EventBridgeBaseClass
<ConfigType
>
Type parameters
Name |
---|
ConfigType |
Parameters
Name | Type |
---|---|
name | string |
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
Name | Type |
---|---|
K | extends EventKey <{ eventbridge-connected : never ; eventbridge-connection-error : unknown ; eventbridge-disconnected : never ; eventbridge-error : unknown ; eventbridge-reconnecting : never }> |
Parameters
Name | Type |
---|---|
eventName | K |
parameter? | { eventbridge-connected : never ; eventbridge-connection-error : unknown ; eventbridge-disconnected : never ; eventbridge-error : unknown ; eventbridge-reconnecting : never }[K ] |
Returns
void
Inherited from
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
Name | Type |
---|---|
K | extends EventKey <{ eventbridge-connected : never ; eventbridge-connection-error : unknown ; eventbridge-disconnected : never ; eventbridge-error : unknown ; eventbridge-reconnecting : never }> |
Parameters
Name | Type |
---|---|
eventName | K |
fn | EventReceiver <{ eventbridge-connected : never ; eventbridge-connection-error : unknown ; eventbridge-disconnected : never ; eventbridge-error : unknown ; eventbridge-reconnecting : never }[K ]> |
Returns
void
Inherited from
Defined in
core/types/GenericEventEmitter.ts:20
on
▸ on<K
>(eventName
, fn
): void
Type parameters
Name | Type |
---|---|
K | extends EventKey <{ eventbridge-connected : never ; eventbridge-connection-error : unknown ; eventbridge-disconnected : never ; eventbridge-error : unknown ; eventbridge-reconnecting : never }> |
Parameters
Name | Type |
---|---|
eventName | K |
fn | EventReceiver <{ eventbridge-connected : never ; eventbridge-connection-error : unknown ; eventbridge-disconnected : never ; eventbridge-error : unknown ; eventbridge-reconnecting : never }[K ]> |
Returns
void
Inherited from
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
Name | Type | Default value | Description |
---|---|---|---|
name | string | undefined | name of span |
opts | SpanOptions | undefined | span options |
context | undefined | Context | undefined | optional context |
fn | (span : Span ) => Promise <F > | undefined | function 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
Name | Type | Description |
---|---|---|
name | string | name of span |
opts | SpanOptions | span options |
fn | (span : Span ) => Promise <F > | function te be executed in the span |
context? | Context | span context |
Returns
Promise
<F
>
return value of fn