Interfaces · @purista/core

ServiceClass

The ServiceClass interface

Signature

ServiceClass.ts typescript
interface ServiceClass<S>

Properties

3 entries

__serviceClassTypes

Property

Source
__serviceClassTypes.ts typescript
__serviceClassTypes: S

Type-only anchor used to preserve cascading service builder types.

config

Property

Source
config.ts typescript
config: S["ConfigType"]

resources

Property

Source
resources.ts typescript
resources: S["Resources"]

Methods

13 entries

destroy

Method

Source
destroy.ts typescript
destroy(): Promise<void>

Stop and destroy the current service

getContextFunctions

Method

Source
getContextFunctions.ts typescript
getContextFunctions(logger: Logger): ContextBase<S["Metrics"]>

getInFlightDiagnostics

Method

Source
getInFlightDiagnostics.ts typescript
getInFlightDiagnostics(): InFlightDiagnostics

getPausedSubscriptionConsumerState

Method

Source
getPausedSubscriptionConsumerState.ts typescript
getPausedSubscriptionConsumerState(): PausedSubscriptionConsumersByRegistrationKey

getQueueWorkerPauseState

Method

Source
getQueueWorkerPauseState.ts typescript
getQueueWorkerPauseState(): QueueWorkerPauseStateByQueue

getServiceHealth

Method

Source
getServiceHealth.ts typescript
getServiceHealth(): Promise<ServiceHealthState>

getTracer

Method

Source
getTracer.ts typescript
getTracer(): Tracer

get the opentelemetry tracer of the service

pauseQueueWorkers

Method

Source
pauseQueueWorkers.ts typescript
pauseQueueWorkers(queueName: string, reason?: string): void

resumeQueueWorkers

Method

Source
resumeQueueWorkers.ts typescript
resumeQueueWorkers(queueName: string): void

resumeSubscriptionConsumer

Method

Source
resumeSubscriptionConsumer.ts typescript
resumeSubscriptionConsumer(registrationKey: string): Promise<void>

start

Method

Source
start.ts typescript
start(): Promise<void>

Start the service

startActiveSpan

Method

Source
startActiveSpan.ts typescript
startActiveSpan<F>(name: string, opts: SpanOptions, context: Context | undefined, fn: (span: Span) => Promise<F>): Promise<F>

Start a new active opentelemetry span with given options. A active span will be below the current span in hierarchy

wrapInSpan

Method

Source
wrapInSpan.ts typescript
wrapInSpan<F>(name: string, opts: SpanOptions, fn: (span: Span) => Promise<F>, context?: Context): Promise<F>

Wrap the given function in an OpenTelemetry span. The span will be on same hierarchy level as the current span.