-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Samchon
committed
Oct 30, 2018
1 parent
c6b3264
commit c640d94
Showing
28 changed files
with
320 additions
and
60 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ node_modules/ | |
build/ | ||
src/ | ||
test/ | ||
bundle/ | ||
|
||
*.log | ||
*.*ignore | ||
|
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,40 @@ | ||
const fs = require("fs"); | ||
const browserify = require('browserify'); | ||
|
||
function bundle(path, output) | ||
{ | ||
return new Promise((resolve, reject) => | ||
{ | ||
let b = browserify([path]); | ||
b.bundle((err, src) => | ||
{ | ||
if (err) | ||
reject(err); | ||
else | ||
{ | ||
fs.writeFile(output, src, (err) => | ||
{ | ||
if (err) | ||
reject(err); | ||
else | ||
resolve(); | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
async function main() | ||
{ | ||
const INSTANCES = | ||
[ | ||
"worker-server", | ||
"worker-client", | ||
"shared-worker-server", | ||
"shared-worker-client", | ||
"web-client" | ||
]; | ||
for (let instance of INSTANCES) | ||
await bundle(`test/protocol/browser/${instance}.js`, `bundle/${instance}.js`); | ||
} | ||
main(); |
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 @@ | ||
<script src="shared-worker-client.js"></script> |
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 @@ | ||
<script src="web-client.js"></script> |
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 @@ | ||
<script src="worker-client.js"></script> |
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,12 @@ | ||
/** | ||
* @hidden | ||
*/ | ||
export interface ICommunicator | ||
{ | ||
/** | ||
* Close handler. | ||
* | ||
* A function called when the connection has been closed. It doesn't matter who've closed the connection, whether user or remote system. | ||
*/ | ||
handleClose: (code: number, reason: string) => void; | ||
} |
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,14 @@ | ||
import { ICommunicator } from "../../internal/ICommunicator"; | ||
|
||
/** | ||
* @hidden | ||
*/ | ||
export interface IWebCommunicator extends ICommunicator | ||
{ | ||
/** | ||
* Communication error handler. | ||
* | ||
* A function called when a communication (protocol) error has been occured. Note that, the error means the protocol level error, not means the logic level error occured by controller or provider. | ||
*/ | ||
handleError: (error: Error) => void; | ||
} |
Oops, something went wrong.