Skip to content

Commit

Permalink
Merge pull request #18 from nfroidure/feat/remove_process_service
Browse files Browse the repository at this point in the history
refactor(process): remove the process service
  • Loading branch information
nfroidure authored Aug 20, 2023
2 parents 0ecda5c + 59051e2 commit e97b44f
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 679 deletions.
15 changes: 0 additions & 15 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
<dt><a href="#initLog">initLog(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Instantiate the logging service</p>
</dd>
<dt><a href="#initProcess">initProcess(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Instantiate the process service</p>
</dd>
<dt><a href="#initRandom">initRandom(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Instantiate the random service</p>
</dd>
Expand Down Expand Up @@ -318,18 +315,6 @@ Logging function
```js
log('debug', 'Luke, I am your father!')
```
<a name="initProcess"></a>
## initProcess(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Instantiate the process service
**Kind**: global function
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of the process object
| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The services to inject |
<a name="initRandom"></a>
## initRandom(services) ⇒ <code>Promise.&lt;function()&gt;</code>
Expand Down
54 changes: 0 additions & 54 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
2. [Time](#12-time)
3. [Randomness](#13-randomness)
4. [Delaying](#14-delaying)
5. [Process](#15-process)
1. [Process name](#151-process-name)
2. [Signals handling](#152-signals-handling)
3. [Handling services fatal errors](#153-handling-services-fatal-errors)
4. [Uncaught exceptions](#154-uncaught-exceptions)
6. [Counter](#16-counter)
7. [Code generator](#17-code-generator)
8. [Lock](#18-lock)
Expand Down Expand Up @@ -81,55 +76,6 @@ The delay service is `setTimeout` like I would like it



### 1.5. Process

The `process` service takes care of the process status.

It returns nothing and should be injected only for its
side effects.

[See in context](./src/process.ts#L32-L37)



#### 1.5.1. Process name

It also set the process name with the actual NODE_ENV.

[See in context](./src/process.ts#L68-L71)



#### 1.5.2. Signals handling

It also handle SIGINT and SIGTERM signals to allow to
gracefully shutdown the running process. The signals
to handle can be customized by injecting the `SIGNALS`
optional dependencies.

[See in context](./src/process.ts#L76-L82)



#### 1.5.3. Handling services fatal errors

If an error occurs it attempts to gracefully exit
to give it a chance to finish properly.

[See in context](./src/process.ts#L87-L91)



#### 1.5.4. Uncaught exceptions

If an uncaught exception occurs it also attempts to
gracefully exit since a process should never be kept
alive when an uncaught exception is raised.

[See in context](./src/process.ts#L98-L103)



### 1.6. Counter

The `counter` service provide a simple, local and
Expand Down
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ This module contains various common injectable
<dt><a href="#initLog">initLog(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Instantiate the logging service</p>
</dd>
<dt><a href="#initProcess">initProcess(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Instantiate the process service</p>
</dd>
<dt><a href="#initRandom">initRandom(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Instantiate the random service</p>
</dd>
Expand Down Expand Up @@ -338,18 +335,6 @@ Logging function
```js
log('debug', 'Luke, I am your father!')
```
<a name="initProcess"></a>
## initProcess(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Instantiate the process service
**Kind**: global function
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of the process object
| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The services to inject |
<a name="initRandom"></a>
## initRandom(services) ⇒ <code>Promise.&lt;function()&gt;</code>
Expand Down
Loading

0 comments on commit e97b44f

Please sign in to comment.