@toa.io/bridges.node 1.0.0-alpha.39 → 1.0.0-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/bridges.node",
3
- "version": "1.0.0-alpha.39",
3
+ "version": "1.0.0-alpha.40",
4
4
  "description": "Toa Node Bridge (inproc)",
5
5
  "homepage": "https://toa.io",
6
6
  "author": {
@@ -26,14 +26,14 @@
26
26
  "test": "echo \"Error: run tests from root\" && exit 1"
27
27
  },
28
28
  "dependencies": {
29
- "@toa.io/core": "1.0.0-alpha.39",
30
- "@toa.io/filesystem": "1.0.0-alpha.39",
31
- "@toa.io/generic": "1.0.0-alpha.39",
29
+ "@toa.io/core": "1.0.0-alpha.40",
30
+ "@toa.io/filesystem": "1.0.0-alpha.40",
31
+ "@toa.io/generic": "1.0.0-alpha.40",
32
32
  "fast-glob": "3.2.7",
33
33
  "matchacho": "0.3.5"
34
34
  },
35
35
  "devDependencies": {
36
36
  "clone-deep": "4.0.1"
37
37
  },
38
- "gitHead": "d9c966c3f8c95c59768e14c61e97d0aeee5ea61f"
38
+ "gitHead": "973a253abb982ddd6cdd7427ef98331d1157180d"
39
39
  }
@@ -24,6 +24,10 @@ class Runner extends Connector {
24
24
  await this.#algorithm.mount?.(this.#context)
25
25
  }
26
26
 
27
+ async close () {
28
+ await this.#algorithm.unmount?.()
29
+ }
30
+
27
31
  async execute (input, state) {
28
32
  const reply = await this.#algorithm.execute(input, state)
29
33
 
@@ -2,22 +2,24 @@ import { bridges } from '@toa.io/core'
2
2
  import * as _context from './context'
3
3
  import * as _core from '@toa.io/core'
4
4
 
5
- declare namespace toa.node{
5
+ declare namespace toa.node {
6
6
 
7
- namespace algorithms{
7
+ namespace algorithms {
8
8
 
9
9
  type Constructor = () => bridges.Algorithm
10
10
 
11
- interface Factory{
11
+ interface Factory {
12
12
  create: Constructor
13
13
  }
14
14
 
15
15
  type func = (input?: any, scope?: object | object[], context?: _context.Context) => Promise<_core.Reply>
16
16
  }
17
17
 
18
- interface Algorithm{
18
+ interface Algorithm {
19
19
  mount? (context: _context.Context): Promise<void> | void
20
20
 
21
+ unmount? (): Promise<void> | void
22
+
21
23
  execute (input: any, scope: object | object[]): Promise<any>
22
24
 
23
25
  execute (input: any): Promise<_core.Reply>