We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfaf524 commit c50b7aeCopy full SHA for c50b7ae
1 file changed
src/clients/edge/EdgeWorker.js
@@ -4,10 +4,9 @@ import { SimpleEmitter } from '../abstracts/SimpleEmitter.js';
4
export class EdgeWorker extends SimpleEmitter {
5
6
static webWorker({ worker = self, ...options }) {
7
- MessagePortPlus.upgradeInPlace(worker);
8
-
9
const instance = new EdgeWorker({ ...options, type: 'worker' });
10
+ MessagePortPlus.upgradeInPlace(worker);
11
worker.addRequestListener('message', async (e) => {
12
const { data: { op, args }, ports: [port] } = e;
13
@@ -34,6 +33,11 @@ export class EdgeWorker extends SimpleEmitter {
34
33
return instance;
35
}
36
+ static http({ ...options }) {
37
+ const instance = new EdgeWorker({ ...options, type: 'http' });
38
+ return instance;
39
+ }
40
+
41
// -------------
42
43
#db;
0 commit comments