@leofcoin/workers 1.3.14 → 1.3.16

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,26 +1,26 @@
1
- {
2
- "name": "@leofcoin/workers",
3
- "version": "1.3.14",
4
- "description": "Workers used in @leofcoin/chain",
5
- "type": "module",
6
- "exports": {
7
- ".": "./src/workers.js",
8
- "./machine-worker": "./src/machine-worker.js",
9
- "./block-worker": "./src/block-worker.js",
10
- "./transaction-worker": "./src/transaction-worker.js",
11
- "./pool-worker": "./src/pool-worker.js"
12
- },
13
- "scripts": {
14
- "test": "echo \"Error: no test specified\" && exit 1"
15
- },
16
- "keywords": [],
17
- "author": "",
18
- "license": "MIT",
19
- "dependencies": {
20
- "@leofcoin/lib": "^1.2.3",
21
- "@leofcoin/messages": "^1.2.0",
22
- "@leofcoin/storage": "^3.3.2",
23
- "@leofcoin/utils": "^1.1.5",
24
- "@vandeurenglenn/easy-worker": "^1.0.2"
25
- }
26
- }
1
+ {
2
+ "name": "@leofcoin/workers",
3
+ "version": "1.3.16",
4
+ "description": "Workers used in @leofcoin/chain",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./src/workers.js",
8
+ "./machine-worker": "./src/machine-worker.js",
9
+ "./block-worker": "./src/block-worker.js",
10
+ "./transaction-worker": "./src/transaction-worker.js",
11
+ "./pool-worker": "./src/pool-worker.js"
12
+ },
13
+ "scripts": {
14
+ "test": "echo \"Error: no test specified\" && exit 1"
15
+ },
16
+ "keywords": [],
17
+ "author": "",
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@leofcoin/lib": "^1.2.3",
21
+ "@leofcoin/messages": "^1.2.0",
22
+ "@leofcoin/storage": "^3.3.2",
23
+ "@leofcoin/utils": "^1.1.5",
24
+ "@vandeurenglenn/easy-worker": "^1.0.2"
25
+ }
26
+ }
@@ -1,31 +1,33 @@
1
- import { BlockMessage } from '@leofcoin/messages'
2
- import { formatBytes, BigNumber } from '@leofcoin/utils'
3
-
4
- import EasyWorker from '@vandeurenglenn/easy-worker'
5
-
6
- const worker = new EasyWorker()
7
-
8
- globalThis.BigNumber = BigNumber
9
- globalThis.contracts = {}
10
-
11
- const run = async (blocks) => {
12
- blocks = await Promise.all(blocks.map(block => new BlockMessage(block)))
13
- blocks = blocks.sort((a, b) => a.decoded.timestamp - b.decoded.timestamp)
14
-
15
- blocks = await Promise.all(blocks.map(block => new Promise(async (resolve, reject) => {
16
- // todo: tx worker or nah?
17
- const size = block.encoded.length || block.encoded.byteLength
18
- console.log(`loaded block: ${await block.hash()} @${block.decoded.index} ${formatBytes(size)}`);
19
- resolve(block)
20
- })))
21
- return blocks
22
- }
23
-
24
- const tasks = async blocks => {
25
- blocks = await run(blocks)
26
- worker.postMessage(blocks)
27
- }
28
-
29
-
30
- worker.onmessage(data => tasks(data))
31
-
1
+ import { BlockMessage } from '@leofcoin/messages'
2
+ import { formatBytes, BigNumber } from '@leofcoin/utils'
3
+
4
+ import EasyWorker from '@vandeurenglenn/easy-worker'
5
+
6
+ const worker = new EasyWorker()
7
+
8
+ globalThis.BigNumber = BigNumber
9
+ globalThis.contracts = {}
10
+
11
+ const run = async (blocks) => {
12
+ blocks = await Promise.all(blocks.map(block => new BlockMessage(block)))
13
+ blocks = blocks.sort((a, b) => a.decoded.timestamp - b.decoded.timestamp)
14
+
15
+ blocks = await Promise.all(blocks.map(block => new Promise(async (resolve, reject) => {
16
+ // todo: tx worker or nah?
17
+ await block.encode()
18
+ const size = block.encoded.length || block.encoded.byteLength
19
+ console.log(`loaded block: ${await block.hash()} @${block.decoded.index} ${formatBytes(size)}`);
20
+ // todo we don't want this, need shared state
21
+ resolve(block.decoded)
22
+ })))
23
+ return blocks
24
+ }
25
+
26
+ const tasks = async blocks => {
27
+ blocks = await run(blocks)
28
+ worker.postMessage(blocks)
29
+ }
30
+
31
+
32
+ worker.onmessage(data => tasks(data))
33
+
package/src/log-worker.ts CHANGED
@@ -1,51 +1,51 @@
1
- import { BlockMessage } from '@leofcoin/messages'
2
- import { formatBytes, BigNumber } from '@leofcoin/utils'
3
-
4
- import EasyWorker from '@vandeurenglenn/easy-worker'
5
- import Storage from '@leofcoin/storage'
6
- const worker = new EasyWorker()
7
- const logStore = new Storage('log')
8
- await logStore.init()
9
-
10
- declare type messageType = 'put' | 'get'
11
-
12
- declare type message = {
13
- type: messageType,
14
- input: string
15
- }
16
-
17
- declare type messageReturn = {
18
- type: messageType,
19
- result?: string,
20
- message?: string,
21
- error?: Error
22
- }
23
-
24
- const handlePut = async message => {
25
- try {
26
- await fetch(`http://localhost:8844/log/put`, {
27
- method: 'put',
28
- body: message
29
- })
30
- } catch (error) {
31
- worker.postMessage({ type: 'logError', message, error })
32
- }
33
- }
34
-
35
- const handleGet = async message => {
36
- try {
37
- await fetch(`http://localhost:8844/log/get?`, {
38
- method: 'put',
39
- body: message
40
- })
41
- } catch (error) {
42
- worker.postMessage({ type: 'logError', message, error })
43
- }
44
- }
45
-
46
- worker.onmessage((message: message) => {
47
- if (!message.type) message.type = 'put'
48
- if (message.type === 'put') handlePut(message.input)
49
- else handleGet(message.input)
50
- })
51
-
1
+ import { BlockMessage } from '@leofcoin/messages'
2
+ import { formatBytes, BigNumber } from '@leofcoin/utils'
3
+
4
+ import EasyWorker from '@vandeurenglenn/easy-worker'
5
+ import Storage from '@leofcoin/storage'
6
+ const worker = new EasyWorker()
7
+ const logStore = new Storage('log')
8
+ await logStore.init()
9
+
10
+ declare type messageType = 'put' | 'get'
11
+
12
+ declare type message = {
13
+ type: messageType,
14
+ input: string
15
+ }
16
+
17
+ declare type messageReturn = {
18
+ type: messageType,
19
+ result?: string,
20
+ message?: string,
21
+ error?: Error
22
+ }
23
+
24
+ const handlePut = async message => {
25
+ try {
26
+ await fetch(`http://localhost:8844/log/put`, {
27
+ method: 'put',
28
+ body: message
29
+ })
30
+ } catch (error) {
31
+ worker.postMessage({ type: 'logError', message, error })
32
+ }
33
+ }
34
+
35
+ const handleGet = async message => {
36
+ try {
37
+ await fetch(`http://localhost:8844/log/get?`, {
38
+ method: 'put',
39
+ body: message
40
+ })
41
+ } catch (error) {
42
+ worker.postMessage({ type: 'logError', message, error })
43
+ }
44
+ }
45
+
46
+ worker.onmessage((message: message) => {
47
+ if (!message.type) message.type = 'put'
48
+ if (message.type === 'put') handlePut(message.input)
49
+ else handleGet(message.input)
50
+ })
51
+
@@ -1,239 +1,240 @@
1
- import { BlockMessage, ContractMessage } from '@leofcoin/messages'
2
- import { formatBytes, BigNumber } from '@leofcoin/utils'
3
- import bytecodes from '@leofcoin/lib/bytecodes' assert {type: 'json'}
4
- import EasyWorker from '@vandeurenglenn/easy-worker'
5
- const worker = new EasyWorker()
6
-
7
- const contractFactoryMessage = bytecodes.contractFactory
8
- const nativeTokenMessage = bytecodes.nativeToken
9
- const nameServiceMessage = bytecodes.nameService
10
- const validatorsMessage = bytecodes.validators
11
-
12
- globalThis.BigNumber = BigNumber
13
- globalThis.contracts = {}
14
-
15
- const unique = arr => arr.filter((el, pos, arr) => {
16
- return arr.indexOf(el) == pos;
17
- })
18
-
19
- const has = address => {
20
- return contracts[address] ? true : false
21
- }
22
-
23
- const get = (contract, method, params) => {
24
- let result
25
- if (params?.length > 0) {
26
- result = contracts[contract][method](...params)
27
- } else {
28
- result = contracts[contract][method]
29
- }
30
- return result
31
- }
32
-
33
- const runContract = async ({decoded, hash, encoded}) => {
34
- const params = decoded.constructorParameters
35
- try {
36
-
37
- const func = new Function(new TextDecoder().decode(decoded.contract))
38
- const Contract = func()
39
-
40
- globalThis.msg = createMessage(decoded.creator)
41
- contracts[hash] = await new Contract(...params)
42
- worker.postMessage({
43
- type: 'debug',
44
- messages: [
45
- `loaded contract: ${hash}`,
46
- `size: ${formatBytes(encoded.length)}`
47
- ]
48
- })
49
- } catch (e) {
50
- console.log(e);
51
- worker.postMessage({
52
- type: 'contractError',
53
- hash: await contractMessage.hash()
54
- })
55
- }
56
- }
57
-
58
- const execute = async (contract, method, params) => {
59
- try {
60
- let result
61
- // don't execute the method on a proxy
62
- if (contracts[contract].fallback) {
63
- result = await contracts[contract].fallback(method, params)
64
- } else {
65
- result = await contracts[contract][method](...params)
66
- }
67
- // state.put(result)
68
- return result
69
- } catch (e) {
70
- throw new Error(
71
- `error: ${e.message}
72
- contract: ${contract}
73
- method: ${method}
74
- params: ${JSON.stringify(params, null, '\t')}
75
- `
76
- )
77
- }
78
- }
79
-
80
-
81
- const createMessage = (sender = globalThis.peerid) => {
82
- return {
83
- sender,
84
- call: execute,
85
- staticCall: get
86
- }
87
- }
88
-
89
- const _init = async ({ contracts, blocks, peerid })=> {
90
-
91
- globalThis.peerid = peerid
92
- contracts = [
93
- contractFactoryMessage,
94
- nativeTokenMessage,
95
- nameServiceMessage,
96
- validatorsMessage
97
- ]
98
-
99
- contracts = await Promise.all(contracts.map(async contract => {
100
- contract = await new ContractMessage(new Uint8Array(contract.split(',')))
101
- await runContract({decoded: contract.decoded, encoded: contract.encoded, hash: await contract.hash()})
102
- return contract
103
- }))
104
-
105
- let lastBlock = {hash: '0x0'};
106
-
107
- if (blocks?.length > 0) {
108
- let pre
109
-
110
- try {
111
- const importee = await import('url')
112
- const url = importee.default
113
- if (url) pre = url.fileURLToPath(new URL('.', import.meta.url));
114
- } catch {
115
- // browser env
116
- pre = './'
117
- }
118
-
119
- const _worker = await new EasyWorker(pre + '@leofcoin/workers/block-worker.js', {serialization: 'advanced', type: 'module' })
120
- blocks = await _worker.once([blocks[blocks.length - 1]])
121
-
122
- // blocks = unique(globalThis.blocks ? globalThis : [], blocks)
123
- // for (let i = 0; i < blocks.length; i++) {
124
-
125
- // }
126
- // for (const block of blocks) {
127
- // await Promise.all(block.decoded.transactions.map(async message => {
128
- // if (!block.loaded) {
129
- // const {from, to, method, params} = message;
130
- // globalThis.msg = createMessage(from);
131
-
132
- // await execute(to, method, params);
133
- // block.loaded = true
134
- // }
135
- // }));
136
- // }
137
-
138
- if (blocks.length > 0) {
139
- lastBlock = blocks[blocks.length - 1].decoded;
140
- lastBlock = await new BlockMessage(lastBlock);
141
-
142
- lastBlock = {
143
- ...lastBlock.decoded,
144
- hash: await lastBlock.hash()
145
- };
146
- }
147
- globalThis.blocks = blocks
148
- }
149
-
150
-
151
-
152
-
153
- worker.postMessage({type: 'machine-ready', lastBlock});
154
-
155
- // worker.postMessage({blocks});
156
- }
157
-
158
- const tasks = async (e) => {
159
- const id = e.id
160
- if (e.type === 'init') {
161
- try {
162
- await _init(e.input)
163
- } catch (e) {
164
- worker.postMessage({
165
- type: 'initError',
166
- message: e.message,
167
- id
168
- })
169
- }
170
- }
171
- if (e.type === 'has') {
172
- try {
173
- const value = await has(e.input.address)
174
- worker.postMessage({
175
- type: 'response',
176
- id,
177
- value
178
- })
179
- } catch (error) {
180
- worker.postMessage({
181
- type: 'hasError',
182
- message: error.message,
183
- id
184
- })
185
- }
186
- }
187
- if (e.type === 'run') {
188
- try {
189
- const value = await runContract(e.input)
190
- worker.postMessage({
191
- type: 'response',
192
- id,
193
- value
194
- })
195
- } catch (e) {
196
- worker.postMessage({
197
- type: 'runError',
198
- message: e.message,
199
- id
200
- })
201
- }
202
- }
203
- if (e.type === 'get') {
204
- try {
205
- const value = await get(e.input.contract, e.input.method, e.input.params)
206
- worker.postMessage({
207
- type: 'response',
208
- id,
209
- value
210
- })
211
- } catch (e) {
212
- worker.postMessage({
213
- type: 'fetchError',
214
- message: e.message,
215
- id
216
- })
217
- }
218
-
219
- }
220
- if (e.type === 'execute') {
221
- try {
222
- const value = await execute(e.input.contract, e.input.method, e.input.params)
223
- worker.postMessage({
224
- type: 'response',
225
- id,
226
- value
227
- })
228
- } catch(e) {
229
- worker.postMessage({
230
- type: 'executionError',
231
- message: e.message,
232
- id
233
-
234
- })
235
- }
236
- }
237
- }
238
-
1
+ import { BlockMessage, ContractMessage } from '@leofcoin/messages'
2
+ import { formatBytes, BigNumber } from '@leofcoin/utils'
3
+ import bytecodes from '@leofcoin/lib/bytecodes' assert {type: 'json'}
4
+ import EasyWorker from '@vandeurenglenn/easy-worker'
5
+ const worker = new EasyWorker()
6
+
7
+ const contractFactoryMessage = bytecodes.contractFactory
8
+ const nativeTokenMessage = bytecodes.nativeToken
9
+ const nameServiceMessage = bytecodes.nameService
10
+ const validatorsMessage = bytecodes.validators
11
+
12
+ globalThis.BigNumber = BigNumber
13
+ globalThis.contracts = {}
14
+
15
+ const unique = arr => arr.filter((el, pos, arr) => {
16
+ return arr.indexOf(el) == pos;
17
+ })
18
+
19
+ const has = address => {
20
+ return contracts[address] ? true : false
21
+ }
22
+
23
+ const get = (contract, method, params) => {
24
+ let result
25
+ if (params?.length > 0) {
26
+ result = contracts[contract][method](...params)
27
+ } else {
28
+ result = contracts[contract][method]
29
+ }
30
+ return result
31
+ }
32
+
33
+ const runContract = async ({decoded, hash, encoded}) => {
34
+ const params = decoded.constructorParameters
35
+ try {
36
+
37
+ const func = new Function(new TextDecoder().decode(decoded.contract))
38
+ const Contract = func()
39
+
40
+ globalThis.msg = createMessage(decoded.creator)
41
+ contracts[hash] = await new Contract(...params)
42
+ worker.postMessage({
43
+ type: 'debug',
44
+ messages: [
45
+ `loaded contract: ${hash}`,
46
+ `size: ${formatBytes(encoded.length)}`
47
+ ]
48
+ })
49
+ } catch (e) {
50
+ console.log(e);
51
+ worker.postMessage({
52
+ type: 'contractError',
53
+ hash: await contractMessage.hash()
54
+ })
55
+ }
56
+ }
57
+
58
+ const execute = async (contract, method, params) => {
59
+ try {
60
+ let result
61
+ // don't execute the method on a proxy
62
+ if (contracts[contract].fallback) {
63
+ result = await contracts[contract].fallback(method, params)
64
+ } else {
65
+ result = await contracts[contract][method](...params)
66
+ }
67
+ // state.put(result)
68
+ return result
69
+ } catch (e) {
70
+ throw new Error(
71
+ `error: ${e.message}
72
+ contract: ${contract}
73
+ method: ${method}
74
+ params: ${JSON.stringify(params, null, '\t')}
75
+ `
76
+ )
77
+ }
78
+ }
79
+
80
+
81
+ const createMessage = (sender = globalThis.peerid) => {
82
+ return {
83
+ sender,
84
+ call: execute,
85
+ staticCall: get
86
+ }
87
+ }
88
+
89
+ const _init = async ({ contracts, blocks, peerid })=> {
90
+
91
+ globalThis.peerid = peerid
92
+ contracts = [
93
+ contractFactoryMessage,
94
+ nativeTokenMessage,
95
+ nameServiceMessage,
96
+ validatorsMessage
97
+ ]
98
+
99
+ contracts = await Promise.all(contracts.map(async contract => {
100
+ contract = await new ContractMessage(new Uint8Array(contract.split(',')))
101
+ await runContract({decoded: contract.decoded, encoded: contract.encoded, hash: await contract.hash()})
102
+ return contract
103
+ }))
104
+
105
+ let lastBlock = {hash: '0x0'};
106
+
107
+ if (blocks?.length > 0) {
108
+ let pre
109
+
110
+ try {
111
+ const importee = await import('url')
112
+ const url = importee.default
113
+ if (url) pre = url.fileURLToPath(new URL('.', import.meta.url));
114
+ } catch {
115
+ // browser env
116
+ pre = './'
117
+ }
118
+
119
+ const _worker = await new EasyWorker(pre + '@leofcoin/workers/block-worker.js', {serialization: 'advanced', type: 'module' })
120
+ blocks = await _worker.once([blocks[blocks.length - 1]])
121
+
122
+ // blocks = unique(globalThis.blocks ? globalThis : [], blocks)
123
+ // for (let i = 0; i < blocks.length; i++) {
124
+
125
+ // }
126
+ // for (const block of blocks) {
127
+ // await Promise.all(block.decoded.transactions.map(async message => {
128
+ // if (!block.loaded) {
129
+ // const {from, to, method, params} = message;
130
+ // globalThis.msg = createMessage(from);
131
+
132
+ // await execute(to, method, params);
133
+ // block.loaded = true
134
+ // }
135
+ // }));
136
+ // }
137
+
138
+ if (blocks.length > 0) {
139
+ lastBlock = blocks[blocks.length - 1];
140
+ // todo blocks already loaded as blockmessage so use it!
141
+ lastBlock = await new BlockMessage(lastBlock);
142
+
143
+ lastBlock = {
144
+ ...lastBlock.decoded,
145
+ hash: await lastBlock.hash()
146
+ };
147
+ }
148
+ globalThis.blocks = blocks
149
+ }
150
+
151
+
152
+
153
+
154
+ worker.postMessage({type: 'machine-ready', lastBlock});
155
+
156
+ // worker.postMessage({blocks});
157
+ }
158
+
159
+ const tasks = async (e) => {
160
+ const id = e.id
161
+ if (e.type === 'init') {
162
+ try {
163
+ await _init(e.input)
164
+ } catch (e) {
165
+ worker.postMessage({
166
+ type: 'initError',
167
+ message: e.message,
168
+ id
169
+ })
170
+ }
171
+ }
172
+ if (e.type === 'has') {
173
+ try {
174
+ const value = await has(e.input.address)
175
+ worker.postMessage({
176
+ type: 'response',
177
+ id,
178
+ value
179
+ })
180
+ } catch (error) {
181
+ worker.postMessage({
182
+ type: 'hasError',
183
+ message: error.message,
184
+ id
185
+ })
186
+ }
187
+ }
188
+ if (e.type === 'run') {
189
+ try {
190
+ const value = await runContract(e.input)
191
+ worker.postMessage({
192
+ type: 'response',
193
+ id,
194
+ value
195
+ })
196
+ } catch (e) {
197
+ worker.postMessage({
198
+ type: 'runError',
199
+ message: e.message,
200
+ id
201
+ })
202
+ }
203
+ }
204
+ if (e.type === 'get') {
205
+ try {
206
+ const value = await get(e.input.contract, e.input.method, e.input.params)
207
+ worker.postMessage({
208
+ type: 'response',
209
+ id,
210
+ value
211
+ })
212
+ } catch (e) {
213
+ worker.postMessage({
214
+ type: 'fetchError',
215
+ message: e.message,
216
+ id
217
+ })
218
+ }
219
+
220
+ }
221
+ if (e.type === 'execute') {
222
+ try {
223
+ const value = await execute(e.input.contract, e.input.method, e.input.params)
224
+ worker.postMessage({
225
+ type: 'response',
226
+ id,
227
+ value
228
+ })
229
+ } catch(e) {
230
+ worker.postMessage({
231
+ type: 'executionError',
232
+ message: e.message,
233
+ id
234
+
235
+ })
236
+ }
237
+ }
238
+ }
239
+
239
240
  worker.onmessage(data => tasks(data))
@@ -1,19 +1,19 @@
1
- import { TransactionMessage } from '@leofcoin/messages'
2
-
3
- import EasyWorker from '@vandeurenglenn/easy-worker'
4
- globalThis.contracts = {}
5
-
6
- const worker = new EasyWorker()
7
-
8
- const tasks = async transactions => {
9
-
10
- transactions = await Promise.all(transactions.map(async message => {
11
- message = await new TransactionMessage(message)
12
-
13
- return {...message.decoded, hash: await message.hash(), size: message.encoded.length}
14
- }))
15
-
16
- worker.postMessage(transactions)
17
-
18
- }
19
- worker.onmessage(data => tasks(data))
1
+ import { TransactionMessage } from '@leofcoin/messages'
2
+
3
+ import EasyWorker from '@vandeurenglenn/easy-worker'
4
+ globalThis.contracts = {}
5
+
6
+ const worker = new EasyWorker()
7
+
8
+ const tasks = async transactions => {
9
+
10
+ transactions = await Promise.all(transactions.map(async message => {
11
+ message = await new TransactionMessage(message)
12
+
13
+ return {...message.decoded, hash: await message.hash(), size: message.encoded.length}
14
+ }))
15
+
16
+ worker.postMessage(transactions)
17
+
18
+ }
19
+ worker.onmessage(data => tasks(data))
@@ -1,12 +1,12 @@
1
- import { TransactionMessage } from '@leofcoin/messages'
2
- globalThis.contracts = {}
3
-
4
- import EasyWorker from '@vandeurenglenn/easy-worker'
5
-
6
- const worker = new EasyWorker()
7
-
8
- worker.onmessage(async (transactions) => {
9
- transactions = await Promise.all(transactions.map(async message => new TransactionMessage(message)))
10
-
11
- worker.postMessage(transactions)
1
+ import { TransactionMessage } from '@leofcoin/messages'
2
+ globalThis.contracts = {}
3
+
4
+ import EasyWorker from '@vandeurenglenn/easy-worker'
5
+
6
+ const worker = new EasyWorker()
7
+
8
+ worker.onmessage(async (transactions) => {
9
+ transactions = await Promise.all(transactions.map(async message => new TransactionMessage(message)))
10
+
11
+ worker.postMessage(transactions)
12
12
  })
package/src/workers.js CHANGED
@@ -1,9 +1,9 @@
1
- import * as transactionWorker from './transaction-worker.js'
2
- import * as blockWorker from './block-worker.js'
3
- import * as poolWorker from './pool-worker.js'
4
- import * as machineWorker from './machine-worker.js'
5
-
6
- export const TransactionWorker = transactionWorker
7
- export const BlockWorker = blockWorker
8
- export const PoolWorker = poolWorker
1
+ import * as transactionWorker from './transaction-worker.js'
2
+ import * as blockWorker from './block-worker.js'
3
+ import * as poolWorker from './pool-worker.js'
4
+ import * as machineWorker from './machine-worker.js'
5
+
6
+ export const TransactionWorker = transactionWorker
7
+ export const BlockWorker = blockWorker
8
+ export const PoolWorker = poolWorker
9
9
  export const MachineWorker = machineWorker