-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into hyperdb-store-refactor
- Loading branch information
Showing
25 changed files
with
274 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Hyperdb Schema Diagram | ||
|
||
A visual representation of [`schema.json`](../hyperdb/schema/schema.json) using [mermaid.js](https://github.com/mermaid-js/mermaid). | ||
|
||
```mermaid | ||
erDiagram | ||
node { | ||
string host "Required" | ||
unit port "Required" | ||
} | ||
dht {} | ||
dht ||--o{ node : nodes | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import dep from './dep.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('-') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script type='module' src='./app.js'></script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "app-without-main", | ||
"pear": { | ||
"name": "app-without-main", | ||
"type": "desktop" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const pipe = Pear.worker.pipe() | ||
pipe.resume() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "worker-child", | ||
"main": "index.js", | ||
"type": "module", | ||
"pear": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const pipe = Pear.worker.pipe() | ||
pipe.resume() | ||
await new Promise((resolve) => setTimeout(resolve, 1000)) | ||
pipe.destroy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "worker-destroy-from-child", | ||
"main": "index.js", | ||
"type": "module", | ||
"pear": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const link = Bare.argv[Bare.argv.length - 1] | ||
const pipe = Pear.worker.run(link) | ||
pipe.resume() | ||
await new Promise((resolve) => setTimeout(resolve, 1000)) | ||
pipe.destroy() | ||
await untilExit(pipe) | ||
|
||
async function untilExit (pipe, timeout = 5000) { | ||
const start = Date.now() | ||
while (isRunning(pipe)) { | ||
if (Date.now() - start > timeout) throw new Error('timed out') | ||
await new Promise((resolve) => setTimeout(resolve, 100)) | ||
} | ||
} | ||
|
||
function isRunning (pipe) { | ||
try { | ||
return process.kill(pipe.pid, 0) | ||
} catch (err) { | ||
return err.code === 'EPERM' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "worker-destroy-from-parent", | ||
"main": "index.js", | ||
"type": "module", | ||
"pear": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const pipe = Pear.worker.pipe() | ||
pipe.resume() | ||
await new Promise((resolve) => setTimeout(resolve, 1000)) | ||
pipe.end() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "worker-end-from-child", | ||
"main": "index.js", | ||
"type": "module", | ||
"pear": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const link = Bare.argv[Bare.argv.length - 1] | ||
const pipe = Pear.worker.run(link) | ||
pipe.resume() | ||
await new Promise((resolve) => setTimeout(resolve, 1000)) | ||
pipe.end() | ||
await untilExit(pipe) | ||
|
||
async function untilExit (pipe, timeout = 5000) { | ||
const start = Date.now() | ||
while (isRunning(pipe)) { | ||
if (Date.now() - start > timeout) throw new Error('timed out') | ||
await new Promise((resolve) => setTimeout(resolve, 100)) | ||
} | ||
} | ||
|
||
function isRunning (pipe) { | ||
try { | ||
return process.kill(pipe.pid, 0) | ||
} catch (err) { | ||
return err.code === 'EPERM' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "worker-end-from-parent", | ||
"main": "index.js", | ||
"type": "module", | ||
"pear": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const link = Bare.argv[Bare.argv.length - 1] | ||
const pipe = Pear.worker.run(link) | ||
pipe.resume() | ||
await untilExit(pipe) | ||
|
||
async function untilExit (pipe, timeout = 5000) { | ||
const start = Date.now() | ||
while (isRunning(pipe)) { | ||
if (Date.now() - start > timeout) throw new Error('timed out') | ||
await new Promise((resolve) => setTimeout(resolve, 100)) | ||
} | ||
} | ||
|
||
function isRunning (pipe) { | ||
try { | ||
return process.kill(pipe.pid, 0) | ||
} catch (err) { | ||
return err.code === 'EPERM' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "worker-parent", | ||
"main": "index.js", | ||
"type": "module", | ||
"pear": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters