PURISTA API / @purista/hono-http-server / HonoServiceClass
Class: HonoServiceClass<Bindings, Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:105
A service which creates a Hono server, adds the command endpoints of given services. The webserver needs to be started programmatically, after the .start method.
Minimal example:
Example
import { serve } from '@hono/node-server'
import { DefaultEventBridge } from '@purista/core'
import { honoV1Service } from '@purista/hono-http-server'
// create and init our eventbridge
const eventBridge = new DefaultEventBridge()
await eventBridge.start()
// add your service
const pingService = await pingV1Service.getInstance(eventBridge)
await pingService.start()
const honoService = await honoV1Service.getInstance(eventBridge, {
serviceConfig: {
enableDynamicRoutes: false,
}
})
honoService.registerService(pingService)
await honoService.start()
const _serverInstance = serve({
fetch: honoService.app.fetch,
port: 3000,
})Extends
Type Parameters
Bindings
Bindings extends BindingsBase = BindingsBase
Variables
Variables extends VariablesBase = VariablesBase
Constructors
Constructor
new HonoServiceClass<
Bindings,Variables>(config):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:124
Parameters
config
ServiceConstructorInput<ServiceClassTypes<{ apiMountPath: string; autoRegisterServicesFromConfig: boolean; enableDynamicRoutes: boolean; enableHealth: boolean; healthFunction?: any; healthPath: string; logLevel: "error" | "info" | "warn" | "debug" | "trace" | "fatal"; openApi?: { components?: any; enabled: boolean; externalDocs?: { description?: string; url: string; }; info: { contact?: { email?: string; name?: string; url?: string; }; description: string; license?: { name: string; url?: string; }; termsOfService?: string; title: string; version: string; }; openapi: string; paths?: Record<string, Record<string, any>>; security?: any[]; servers?: object[]; tags?: object[]; }; problemDetails?: { typeBaseUri?: string; }; protectHandler?: any; services: Service<any>[]; streamRequestTimeoutMs: number; traceHeaderField: string; }, EmptyObject>>
Returns
HonoServiceClass<Bindings, Variables>
Overrides
Properties
__serviceClassTypes?
readonlyoptional__serviceClassTypes?:ServiceClassTypes<{apiMountPath:string;autoRegisterServicesFromConfig:boolean;enableDynamicRoutes:boolean;enableHealth:boolean;healthFunction?:any;healthPath:string;logLevel:"error"|"info"|"warn"|"debug"|"trace"|"fatal";openApi?: {components?:any;enabled:boolean;externalDocs?: {description?:string;url:string; };info: {contact?: {email?:string;name?:string;url?:string; };description:string;license?: {name:string;url?:string; };termsOfService?:string;title:string;version:string; };openapi:string;paths?:Record<string,Record<string,any>>;security?:any[];servers?:object[];tags?:object[]; };problemDetails?: {typeBaseUri?:string; };protectHandler?:any;services:Service<any>[];streamRequestTimeoutMs:number;traceHeaderField:string; }>
Defined in: core/dist/core/Service/Service.impl.d.ts:60
Type-only anchor used to preserve cascading service builder types.
This property is never read at runtime.
Inherited from
activeStreamSessions
protectedactiveStreamSessions:Map<string, {cancelled:boolean;cancelReason?:string;onCancel: (reason?) =>void[]; }>
Defined in: core/dist/core/Service/Service.impl.d.ts:66
Inherited from
app
app:
Hono<{Bindings:Bindings;Variables:Variables; },BlankSchema,"/">
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:112
The Hono instance
commandDefinitionList
commandDefinitionList:
CommandDefinitionListResolved<any>
Defined in: core/dist/core/Service/Service.impl.d.ts:81
Inherited from
commands
protectedcommands:Map<string,CommandDefinition<any,any,any,any,any,any,any,any,any,any,EmptyObject,any,any,any>>
Defined in: core/dist/core/Service/Service.impl.d.ts:62
Inherited from
config
config:
object
Defined in: core/dist/core/Service/Service.impl.d.ts:84
apiMountPath
apiMountPath:
string
autoRegisterServicesFromConfig
autoRegisterServicesFromConfig:
boolean
enableDynamicRoutes
enableDynamicRoutes:
boolean
enableHealth
enableHealth:
boolean
healthFunction?
optionalhealthFunction?:any
healthPath
healthPath:
string
logLevel
logLevel:
"error"|"info"|"warn"|"debug"|"trace"|"fatal"
openApi?
optionalopenApi?:object
openApi.components?
optionalcomponents?:any
openApi.enabled
enabled:
boolean
openApi.externalDocs?
optionalexternalDocs?:object
openApi.externalDocs.description?
optionaldescription?:string
openApi.externalDocs.url
url:
string
openApi.info
info:
object=InfoObjectSchema
openApi.info.contact?
optionalcontact?:object
openApi.info.contact.email?
optionalemail?:string
openApi.info.contact.name?
optionalname?:string
openApi.info.contact.url?
optionalurl?:string
openApi.info.description
description:
string
openApi.info.license?
optionallicense?:object
openApi.info.license.name
name:
string
openApi.info.license.url?
optionalurl?:string
openApi.info.termsOfService?
optionaltermsOfService?:string
openApi.info.title
title:
string
openApi.info.version
version:
string
openApi.openapi
openapi:
string
openApi.paths?
optionalpaths?:Record<string,Record<string,any>>
openApi.security?
optionalsecurity?:any[]
openApi.servers?
optionalservers?:object[]
openApi.tags?
optionaltags?:object[]
problemDetails?
optionalproblemDetails?:object
problemDetails.typeBaseUri?
optionaltypeBaseUri?:string
protectHandler?
optionalprotectHandler?:any
services
services:
Service<any>[]
streamRequestTimeoutMs
streamRequestTimeoutMs:
number
traceHeaderField
traceHeaderField:
string
Inherited from
configSchema
protectedconfigSchema:Schema|undefined
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:30
Inherited from
configStore
protectedconfigStore:ConfigStore
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:28
Inherited from
eventBridge
protectedeventBridge:EventBridge
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:23
Inherited from
info
readonlyinfo:ServiceInfoType
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:22
Inherited from
isStarted
isStarted:
boolean
Defined in: core/dist/core/Service/Service.impl.d.ts:86
Inherited from
logger
logger:
Logger
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:24
Inherited from
metricContext
protectedmetricContext:PuristaMetricContext<PuristaMetricDefinitions>
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:33
Inherited from
metricDefinitions
protectedmetricDefinitions:PuristaMetricDefinitions
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:32
Inherited from
metricsRecorder
protectedmetricsRecorder:PuristaMetricsRecorderInterface
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:31
Inherited from
openApi
openApi:
OpenApiBuilder
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:117
The OpenApiBuilder instance
queueDefinitionList
protectedqueueDefinitionList:QueueDefinitionListResolved<any>
Defined in: core/dist/core/Service/Service.impl.d.ts:64
Inherited from
queueWorkerDefinitionList
protectedqueueWorkerDefinitionList:QueueWorkerDefinitionListResolved<any>
Defined in: core/dist/core/Service/Service.impl.d.ts:65
Inherited from
Service.queueWorkerDefinitionList
resources
resources:
EmptyObject
Defined in: core/dist/core/Service/Service.impl.d.ts:85
Inherited from
secretStore
protectedsecretStore:SecretStore
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:27
Inherited from
spanProcessor
spanProcessor:
SpanProcessor|undefined
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:25
Inherited from
stateStore
protectedstateStore:StateStore
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:29
Inherited from
streamDefinitionList
streamDefinitionList:
StreamDefinitionListResolved<any>
Defined in: core/dist/core/Service/Service.impl.d.ts:83
Inherited from
streams
protectedstreams:Map<string,StreamDefinition<any,any,any,any,any,any,any,EmptyObject,any,any,any>>
Defined in: core/dist/core/Service/Service.impl.d.ts:63
Inherited from
subscriptionDefinitionList
subscriptionDefinitionList:
SubscriptionDefinitionListResolved<any>
Defined in: core/dist/core/Service/Service.impl.d.ts:82
Inherited from
Service.subscriptionDefinitionList
subscriptions
protectedsubscriptions:Map<string,SubscriptionDefinition<any,any,any,any,any,any,any,any,EmptyObject,any,any,any>>
Defined in: core/dist/core/Service/Service.impl.d.ts:61
Inherited from
traceProvider
traceProvider:
NodeTracerProvider
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:26
Inherited from
Accessors
name
Get Signature
get name():
string
Defined in: core/dist/core/Service/Service.impl.d.ts:88
Returns
string
Inherited from
serviceInfo
Get Signature
get serviceInfo():
ServiceInfoType
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:50
Get service info
Returns
Inherited from
Methods
addEndpoint()
addEndpoint(
metadata,service):void
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:376
Adds a single service command endpoint to the Hono router
Parameters
metadata
Command metadata produced by the builder
service
Address of the service hosting the command
Returns
void
destroy()
destroy():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:724
Stop and destroy the current service
Returns
Promise<void>
Overrides
executeCommand()
executeCommand(
message):Promise<Readonly<Omit<{contentEncoding:"utf-8";contentType:"application/json";correlationId:string;eventName?:string;id:string;isHandledError:boolean;messageType:CommandErrorResponse;otp?:string;payload: {data?:unknown;message:string;status:StatusCode; };principalId?:string;receiver: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };sender: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };tenantId?:string;timestamp:number;traceId?:string; },"instanceId">> | {contentEncoding:string;contentType:string;correlationId:string;eventName?:string;id:string;messageType:CommandSuccessResponse;otp:string;payload:unknown;principalId?:string;receiver: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };sender: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };tenantId?:string;timestamp:number;traceId?:string; }>
Defined in: core/dist/core/Service/Service.impl.d.ts:156
Called when a command is received by the service
Parameters
message
Readonly<Command>
Command envelope to execute
Returns
Promise<Readonly<Omit<{ contentEncoding: "utf-8"; contentType: "application/json"; correlationId: string; eventName?: string; id: string; isHandledError: boolean; messageType: CommandErrorResponse; otp?: string; payload: { data?: unknown; message: string; status: StatusCode; }; principalId?: string; receiver: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; tenantId?: string; timestamp: number; traceId?: string; }, "instanceId">> | { contentEncoding: string; contentType: string; correlationId: string; eventName?: string; id: string; messageType: CommandSuccessResponse; otp: string; payload: unknown; principalId?: string; receiver: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; tenantId?: string; timestamp: number; traceId?: string; }>
Inherited from
executeStream()
executeStream(
message):Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:212
Parameters
message
Readonly<StreamMessage>
Returns
Promise<void>
Inherited from
executeSubscription()
executeSubscription(
message,subscriptionName):Promise<Omit<{contentEncoding:string;contentType:string;correlationId?:string;eventName:string;id:string;messageType:CustomMessage;otp?:string;payload?:unknown;principalId?:string;receiver?:EBMessageAddress;sender: {instanceId:string;serviceName:string;serviceTarget:string;serviceVersion:string; };tenantId?:string;timestamp:number;traceId?:string; },"id"|"timestamp"> |undefined>
Defined in: core/dist/core/Service/Service.impl.d.ts:214
Parameters
message
Readonly<EBMessage>
subscriptionName
string
Returns
Promise<Omit<{ contentEncoding: string; contentType: string; correlationId?: string; eventName: string; id: string; messageType: CustomMessage; otp?: string; payload?: unknown; principalId?: string; receiver?: EBMessageAddress; sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string; }; tenantId?: string; timestamp: number; traceId?: string; }, "id" | "timestamp"> | undefined>
Inherited from
getConsumeStreamFunction()
protectedgetConsumeStreamFunction<StreamInvokes>(serviceTarget,traceId?,principalId?,tenantId?,streamInvokes?):OpenStreamFunction
Defined in: core/dist/core/Service/Service.impl.d.ts:147
Type Parameters
StreamInvokes
StreamInvokes extends StreamInvokeList
Parameters
serviceTarget
string
traceId?
string
principalId?
string
tenantId?
string
streamInvokes?
StreamInvokes
Returns
Inherited from
Service.getConsumeStreamFunction
getContextFunctions()
getContextFunctions(
logger,queueNamespace?):ContextBase
Defined in: core/dist/core/Service/Service.impl.d.ts:150
Parameters
logger
queueNamespace?
Returns
Inherited from
getEmitFunction()
protectedgetEmitFunction<EmitList>(serviceTarget,traceId?,principalId?,tenantId?,emitList?): <K,Payload>(eventName,eventPayload?,contentType?,contentEncoding?) =>Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:148
Type Parameters
EmitList
EmitList extends Record<string, Schema> = EmptyObject
Parameters
serviceTarget
string
traceId?
string
principalId?
string
tenantId?
string
emitList?
EmitList
Returns
<K, Payload>(eventName, eventPayload?, contentType?, contentEncoding?) => Promise<void>
Inherited from
getInFlightDiagnostics()
getInFlightDiagnostics():
InFlightDiagnostics
Defined in: core/dist/core/Service/Service.impl.d.ts:206
Returns
Inherited from
Service.getInFlightDiagnostics
getInvokeFunction()
protectedgetInvokeFunction<Invokes>(serviceTarget,traceId?,principalId?,tenantId?,invokes?): <Payload,Parameter>(receiver,invokePayload,invokeparameter,contentType?,contentEncoding?) =>Promise<any>
Defined in: core/dist/core/Service/Service.impl.d.ts:108
Type Parameters
Invokes
Invokes extends InvokeList
Parameters
serviceTarget
string
traceId?
string
principalId?
string
tenantId?
string
invokes?
Invokes
Returns
<Payload, Parameter>(receiver, invokePayload, invokeparameter, contentType?, contentEncoding?) => Promise<any>
Inherited from
getPausedSubscriptionConsumerState()
getPausedSubscriptionConsumerState():
PausedSubscriptionConsumersByRegistrationKey
Defined in: core/dist/core/Service/Service.impl.d.ts:208
Returns
PausedSubscriptionConsumersByRegistrationKey
Inherited from
Service.getPausedSubscriptionConsumerState
getQueueNamespace()
protectedgetQueueNamespace(queueInvokes?,traceId?,principalId?,tenantId?):object
Defined in: core/dist/core/Service/Service.impl.d.ts:109
Parameters
queueInvokes?
traceId?
string
principalId?
string
tenantId?
string
Returns
object
enqueue
enqueue:
QueueInvokeFunction&QueueInvokeClientMap<QueueInvokeList>
scheduleAt
scheduleAt:
QueueScheduleFunction&QueueScheduleProxy<QueueInvokeClientMap<QueueInvokeList>>
Inherited from
getQueueWorkerPauseState()
getQueueWorkerPauseState():
QueueWorkerPauseStateByQueue
Defined in: core/dist/core/Service/Service.impl.d.ts:207
Returns
Inherited from
Service.getQueueWorkerPauseState
getServiceHealth()
getServiceHealth():
Promise<ServiceHealthState>
Defined in: core/dist/core/Service/Service.impl.d.ts:204
Returns
Promise<ServiceHealthState>
Inherited from
getTracer()
getTracer(
name?,version?):Tracer
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:56
Returns open telemetry tracer of this service
Parameters
name?
string
version?
string
Returns
Tracer
Tracer
Inherited from
initializeEventbridgeConnect()
protectedinitializeEventbridgeConnect(commandDefinitionList,subscriptions,streams):Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:100
Connect service to event bridge to receive commands and command responses
Parameters
commandDefinitionList
CommandDefinitionListResolved<any>
subscriptions
SubscriptionDefinitionListResolved<any>
streams
StreamDefinitionListResolved<any>
Returns
Promise<void>
Inherited from
Service.initializeEventbridgeConnect
initializeQueues()
protectedinitializeQueues():Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:101
Returns
Promise<void>
Inherited from
invoke()
invoke<
T>(input,endpoint):Promise<T>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:643
Type Parameters
T
T
Parameters
input
Omit<Command, "id" | "messageType" | "timestamp" | "correlationId" | "sender">
endpoint
string
Returns
Promise<T>
openStream()
openStream(
input,endpoint,timeoutMs?):Promise<StreamHandle<unknown,unknown>>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:658
Parameters
input
Omit<Command, "id" | "messageType" | "timestamp" | "correlationId" | "sender">
endpoint
string
timeoutMs?
number = ...
Returns
Promise<StreamHandle<unknown, unknown>>
pauseQueueWorkers()
pauseQueueWorkers(
queueName,reason?):void
Defined in: core/dist/core/Service/Service.impl.d.ts:209
Parameters
queueName
string
reason?
string
Returns
void
Inherited from
prepareDestroy()
prepareDestroy():
object
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:717
Helper function to be used in gracefulShutdown. It prevents to handle new requests during shut down. Incoming requests are rejected with 503 Service Unavailable.
Returns
destroy
destroy: () =>
Promise<void>
Set the service unavailable The webserver will return 503 Service Unavailable
Returns
Promise<void>
name
name:
string
Example
gracefulShutdown(logger, [
honoService.prepareDestroy(),
eventbridge,
...services,
honoService
])registerCommand()
registerCommand(
commandDefinition):Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:192
Parameters
commandDefinition
CommandDefinition<any, any, any, any, any, any, any, any, any, any, EmptyObject, any, any, any>
Returns
Promise<void>
Inherited from
registerService()
registerService(...
services):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:348
Register a service instance. Must be called before .start. Adds the endpoints of the service commands to the Hono router
Parameters
services
...AnyService[]
Returns
HonoServiceClass<Bindings, Variables>
registerStream()
registerStream(
streamDefinition):Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:213
Parameters
streamDefinition
StreamDefinition<any, any, any, any, any, any, any, EmptyObject, any, any, any>
Returns
Promise<void>
Inherited from
registerSubscription()
registerSubscription(
subscriptionDefinition):Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:215
Parameters
subscriptionDefinition
SubscriptionDefinition<any, any, any, any, any, any, any, any, EmptyObject, any, any, any>
Returns
Promise<void>
Inherited from
resumeQueueWorkers()
resumeQueueWorkers(
queueName):void
Defined in: core/dist/core/Service/Service.impl.d.ts:210
Parameters
queueName
string
Returns
void
Inherited from
resumeSubscriptionConsumer()
resumeSubscriptionConsumer(
registrationKey):Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:211
Parameters
registrationKey
string
Returns
Promise<void>
Inherited from
Service.resumeSubscriptionConsumer
sendServiceInfo()
protectedsendServiceInfo(infoType,target?,payload?):Promise<Readonly<EBMessage>>
Defined in: core/dist/core/Service/Service.impl.d.ts:107
Broadcast service info message
Parameters
infoType
type of info message
target?
string
function name is need in messages like InfoServiceFunctionAdded
payload?
Record<string, unknown>
Returns
Promise<Readonly<EBMessage>>
Inherited from
setHealthFunction()
setHealthFunction(
fn):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:161
Set a custom health function
Parameters
fn
HealthFunction<HonoServiceClass<Bindings, Variables>>
Returns
HonoServiceClass<Bindings, Variables>
setHonoTypes()
setHonoTypes<
E>():HonoServiceClass<Bindings&E["Bindings"],Variables&E["Variables"]>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:148
Set the Hono types for Variables and Bindings.
Type Parameters
E
E extends object = { Bindings: EmptyObject; Variables: EmptyObject; }
Returns
HonoServiceClass<Bindings & E["Bindings"], Variables & E["Variables"]>
The service instance with propper types
setProtectMiddleware()
setProtectMiddleware(
fn):HonoServiceClass<Bindings,Variables>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:181
Set the middleware which will be executed on all endpoints which are marked as secured/protected. It can also be used to enhance input information.
Parameters
fn
EndpointProtectMiddleware<HonoServiceClass<Bindings, Variables>, Bindings, Variables>
Returns
HonoServiceClass<Bindings, Variables>
Example
honoService.setProtectHandler(async function (c, next) {
const auth = basicAuth({ username: 'user', password: 'password' })
c.set('additionalParameter', { userId: '123' })
return auth(c, next)
})setServiceAvailable()
setServiceAvailable():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:697
Set the service available Request will be processed.
Returns
Promise<void>
setServiceUnavailable()
setServiceUnavailable():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:689
Set the service unavailable The webserver will return 503 Service Unavailable
Returns
Promise<void>
start()
start():
Promise<void>
Defined in: hono-http-server/src/service/hono/v1/HonoServiceClass.ts:207
It connects to the event bridge and subscribes to the topics that are in the subscription list.
Returns
Promise<void>
Overrides
startActiveSpan()
startActiveSpan<
F>(name,opts,context,fn):Promise<F>
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:65
Start a child span for opentelemetry tracking
Type Parameters
F
F
Parameters
name
string
name of span
opts
SpanOptions
span options
context
Context | undefined
optional context
fn
(span) => Promise<F>
function to be executed within the span
Returns
Promise<F>
return value of fn
Inherited from
startQueueWorkers()
protectedstartQueueWorkers():void
Defined in: core/dist/core/Service/Service.impl.d.ts:193
Returns
void
Inherited from
stopQueueWorkers()
protectedstopQueueWorkers():Promise<void>
Defined in: core/dist/core/Service/Service.impl.d.ts:194
Returns
Promise<void>
Inherited from
wrapInSpan()
wrapInSpan<
F>(name,opts,fn,context?):Promise<F>
Defined in: core/dist/core/Service/ServiceBaseClass/ServiceBaseClass.impl.d.ts:81
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
F
F
Parameters
name
string
name of span
opts
SpanOptions
span options
fn
(span) => Promise<F>
function te be executed in the span
context?
Context
span context
Returns
Promise<F>
return value of fn
