Skip to main content

terafoundation / process-context / ProcessContext

Class: ProcessContext<S, A, D>

A Single Process Context, this should be used when running in a single process instance/container. This context doesn't support some of the multiple worker/assignment variations that ClusterContext does, like master or worker.

Todo

add process event handler listeners in initialize method

Todo

add shutdown handler logic with shutdown method

Extends

Type parameters

Type parameterValue
SRecord<string, any>
ARecord<string, any>
D extends stringstring

Constructors

new ProcessContext()

new ProcessContext<S, A, D>(config, cluster, sysconfig, assignment?): ProcessContext<S, A, D>

Parameters

ParameterType
configConfig<S, A, D>
clusterCluster
sysconfigSysConfig<S>
assignment?D

Returns

ProcessContext<S, A, D>

Inherited from

CoreContext.constructor

Source

core-context.ts:23

Properties

apis

readonly apis: ContextAPIs & A

Inherited from

CoreContext.apis

Source

core-context.ts:15


arch

readonly arch: Architecture = process.arch

Inherited from

CoreContext.arch

Source

core-context.ts:18


assignment

assignment: D

Inherited from

CoreContext.assignment

Source

core-context.ts:20


cluster

readonly cluster: Cluster

Inherited from

CoreContext.cluster

Source

core-context.ts:13


cluster_name?

optional cluster_name: string

Inherited from

CoreContext.cluster_name

Source

core-context.ts:21


logger

readonly logger: Logger

Inherited from

CoreContext.logger

Source

core-context.ts:16


name

readonly name: string

Inherited from

CoreContext.name

Source

core-context.ts:17


platform

readonly platform: Platform = process.platform

Inherited from

CoreContext.platform

Source

core-context.ts:19


sysconfig

readonly sysconfig: SysConfig<S>

Inherited from

CoreContext.sysconfig

Source

core-context.ts:14

Methods

createContext()

static createContext<S, A, D>(config, overrideArgs?): Promise<ProcessContext<S, A, D>>

Type parameters

Type parameterValue
SRecord<string, any>
ARecord<string, any>
D extends stringstring

Parameters

ParameterType
configConfig<S, A, D>
overrideArgs?ParsedArgs<S>

Returns

Promise<ProcessContext<S, A, D>>

Source

process-context.ts:22