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
CoreContext
<S
,A
,D
>
Type parameters
Type parameter | Value |
---|---|
S | Record <string , any > |
A | Record <string , any > |
D extends string | string |
Constructors
new ProcessContext()
new ProcessContext<
S
,A
,D
>(config
,cluster
,sysconfig
,assignment
?):ProcessContext
<S
,A
,D
>
Parameters
Parameter | Type |
---|---|
config | Config <S , A , D > |
cluster | Cluster |
sysconfig | SysConfig <S > |
assignment ? | D |
Returns
ProcessContext
<S
, A
, D
>
Inherited from
Source
Properties
apis
readonly
apis:ContextAPIs
&A
Inherited from
Source
arch
readonly
arch:Architecture
=process.arch
Inherited from
Source
assignment
assignment:
D
Inherited from
Source
cluster
readonly
cluster:Cluster
Inherited from
Source
cluster_name?
optional
cluster_name:string
Inherited from
Source
logger
readonly
logger:Logger
Inherited from
Source
name
readonly
name:string
Inherited from
Source
platform
readonly
platform:Platform
=process.platform
Inherited from
Source
sysconfig
readonly
sysconfig:SysConfig
<S
>
Inherited from
Source
Methods
createContext()
static
createContext<S
,A
,D
>(config
,overrideArgs
?):Promise
<ProcessContext
<S
,A
,D
>>
Type parameters
Type parameter | Value |
---|---|
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
>>