dcp-client 4.2.16 → 4.2.17

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.
@@ -0,0 +1,28 @@
1
+ // How to deploy a job using ES6 modules.
2
+
3
+ import { init } from '../../index.js';
4
+
5
+ const { compute } = await init();
6
+
7
+ const inputSet = [1, 2, 3, 4];
8
+
9
+ const workFunction = (input) => {
10
+ progress();
11
+ return input;
12
+ };
13
+
14
+ const job = compute.for(inputSet, workFunction);
15
+
16
+ job.public.name = 'ESM example';
17
+
18
+ job.on('accepted', ({ job: { id } }) => {
19
+ console.log('Job accepted with id', id);
20
+ });
21
+
22
+ job.on('result', ({ result }) => {
23
+ console.log('Received a result:', result);
24
+ });
25
+
26
+ const results = await job.exec();
27
+
28
+ console.log(results);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcp-client",
3
- "version": "4.2.16",
3
+ "version": "4.2.17",
4
4
  "description": "Core libraries for accessing DCP network",
5
5
  "keywords": [
6
6
  "dcp"
@@ -33,7 +33,6 @@
33
33
  "btoa": "^1.2.1",
34
34
  "chalk": "^2.4.2",
35
35
  "html-to-text": "^5.1.1",
36
- "http-agent": "^0.1.2",
37
36
  "http-proxy-agent": "^4.0.1",
38
37
  "https-agent": "^1.0.0",
39
38
  "https-proxy-agent": "^5.0.0",