@hazae41/turbine 0.1.5 → 0.1.6
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.
|
@@ -32,7 +32,6 @@ export async function main(args) {
|
|
|
32
32
|
console.log("Starting...");
|
|
33
33
|
const worker = await RpcWorkerClient.spawn(uuid, path);
|
|
34
34
|
const server = new Server(worker);
|
|
35
|
-
await server.setup();
|
|
36
35
|
Deno.serve({ hostname: "0.0.0.0", port }, (request) => server.respond(request));
|
|
37
36
|
}
|
|
38
37
|
if (import.meta.main) {
|
|
@@ -9,7 +9,6 @@ export declare class Server {
|
|
|
9
9
|
readonly worker: RpcWorkerClient;
|
|
10
10
|
readonly subserver: RpcServer;
|
|
11
11
|
constructor(worker: RpcWorkerClient);
|
|
12
|
-
setup(): Promise<void>;
|
|
13
12
|
respond(request: Request): Promise<any>;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
@@ -21,6 +20,5 @@ export declare class RpcServer {
|
|
|
21
20
|
readonly seens: Set<string>;
|
|
22
21
|
readonly mutex: Mutex<undefined>;
|
|
23
22
|
constructor(worker: RpcWorkerClient);
|
|
24
|
-
setup(): Promise<void>;
|
|
25
23
|
respond(request: RpcRequestInit): Promise<RpcErr | RpcOk<string>>;
|
|
26
24
|
}
|
|
@@ -64,9 +64,6 @@ export class Server {
|
|
|
64
64
|
this.worker = worker;
|
|
65
65
|
this.subserver = new RpcServer(worker);
|
|
66
66
|
}
|
|
67
|
-
async setup() {
|
|
68
|
-
await this.subserver.setup();
|
|
69
|
-
}
|
|
70
67
|
async respond(request) {
|
|
71
68
|
const response = await this.#route(request);
|
|
72
69
|
response.headers.set("Access-Control-Allow-Origin", "*");
|
|
@@ -103,9 +100,6 @@ export class RpcServer {
|
|
|
103
100
|
constructor(worker) {
|
|
104
101
|
this.worker = worker;
|
|
105
102
|
}
|
|
106
|
-
async setup() {
|
|
107
|
-
await this.worker.setup();
|
|
108
|
-
}
|
|
109
103
|
async respond(request) {
|
|
110
104
|
try {
|
|
111
105
|
return new RpcOk(request.id, await this.#route(request));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@hazae41/turbine",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"description": "Bobine over HTTP and WebSocket",
|
|
6
6
|
"repository": "github:hazae41/turbine",
|
|
7
7
|
"author": "hazae41",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@hazae41/binary": "^2.1.1",
|
|
26
|
-
"@hazae41/bobine": "^0.1.
|
|
26
|
+
"@hazae41/bobine": "^0.1.7",
|
|
27
27
|
"@hazae41/jsonrpc": "^1.2.1",
|
|
28
28
|
"@hazae41/mutex": "^3.0.1",
|
|
29
|
-
"@hazae41/webpack": "^1.0.
|
|
29
|
+
"@hazae41/webpack": "^1.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@hazae41/phobos": "^2.0.16",
|