terafoundation / process-context / ProcessContext
Class: ProcessContext<S, A, D>
Defined in: process-context.ts:17
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
CoreContext<S,A,D>
Type Parameters
| Type Parameter | Default type |
|---|---|
S | Record<string, any> |
A | Record<string, any> |
D extends string | string |
Constructors
Constructor
new ProcessContext<
S,A,D>(config,cluster,sysconfig,assignment?):ProcessContext<S,A,D>
Defined in: core-context.ts:23
Parameters
| Parameter | Type |
|---|---|
config | Config<S, A, D> |
cluster | Cluster |
sysconfig | SysConfig<S> |
assignment? | D |
Returns
ProcessContext<S, A, D>
Inherited from
Properties
| Property | Modifier | Type | Default value | Inherited from | Defined in |
|---|---|---|---|---|---|
apis | readonly | ContextAPIs & A | undefined | CoreContext.apis | core-context.ts:15 |
arch | readonly | Architecture | process.arch | CoreContext.arch | core-context.ts:18 |
assignment | public | D | undefined | CoreContext.assignment | core-context.ts:20 |
cluster | readonly | Cluster | undefined | CoreContext.cluster | core-context.ts:13 |
cluster_name? | public | string | undefined | CoreContext.cluster_name | core-context.ts:21 |
logger | readonly | Logger | undefined | CoreContext.logger | core-context.ts:16 |
name | readonly | string | undefined | CoreContext.name | core-context.ts:17 |
platform | readonly | Platform | process.platform | CoreContext.platform | core-context.ts:19 |
sysconfig | readonly | SysConfig<S> | undefined | CoreContext.sysconfig | core-context.ts:14 |
Methods
createContext()
staticcreateContext<S,A,D>(config,overrideArgs?):Promise<ProcessContext<S,A,D>>
Defined in: process-context.ts:22
Type Parameters
| Type Parameter | Default type |
|---|---|
S | Record<string, any> |
A | Record<string, any> |
D extends string | string |
Parameters
| Parameter | Type |
|---|---|
config | Config<S, A, D> |
overrideArgs? | ParsedArgs<S> |
Returns
Promise<ProcessContext<S, A, D>>