-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
9769496
commit 9a3c88a
Showing
11 changed files
with
50 additions
and
49 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 |
---|---|---|
|
@@ -5,3 +5,4 @@ readme-draft.de.md | |
webspree_session.json | ||
built/ | ||
example-node/sort_worka.js | ||
sort_worka.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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# Changelog | ||
|
||
## 10.0.0 | ||
|
||
* Worker is a module by default. | ||
* Works with Deno. | ||
|
||
|
||
## 9.1.0 | ||
|
||
|
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 @@ | ||
import makeloc from 'https://cdn.deno.land/dirname/versions/1.1.2/raw/mod.ts'//https://x.nest.land/[email protected]/mod.ts' | ||
|
||
|
||
const { __dirname, __filename } = makeloc(import.meta); | ||
|
||
|
||
console.log(`${__dirname}w.ts`.substr(1)); | ||
|
||
const tsWorker = new Worker(`file:///${`${__dirname}w.ts`.substr(1)}`, { | ||
type: "module", | ||
}); | ||
tsWorker.postMessage("Hello World"); |
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 |
---|---|---|
|
@@ -2,19 +2,17 @@ import { registerWorker, FILE, NO_SUPPORT_ERROR, TIME_OUT_ERROR, work } from ".. | |
import makeloc from 'https://cdn.deno.land/dirname/versions/1.1.2/raw/mod.ts'//https://x.nest.land/[email protected]/mod.ts' | ||
|
||
|
||
const { __dirname, __filename } = makeloc(import.meta) | ||
const { __dirname, __filename } = makeloc(import.meta); | ||
|
||
|
||
console.log(`${__dirname}/sort_worka.js`.substr(1)); | ||
console.log(`${__dirname}/w.ts`.substr(1)); | ||
|
||
const tsWorker = new Worker(`${__dirname}/w.ts`.substr(1)); | ||
tsWorker.postMessage("Hello World"); | ||
// console.log(`${__dirname}sort_worka.js`.substr(1)); | ||
|
||
registerWorker({ | ||
name: `sort`, | ||
resource: `${__dirname}/sort_worka.js`.substr(1), | ||
loadMode: FILE | ||
resource: `file:///${`${__dirname}..\\sort_worka.js`.substr(1)}`, | ||
loadMode: FILE, | ||
hope: 0, | ||
timeout: 100, | ||
}); | ||
|
||
work({ name: `sort`, input: [1, 2, 3, -8, -5, 2, 3, 45, 5] }).then(function (result) { | ||
|
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
# use worka in Deno | ||
|
||
**Warning** Does not work | ||
|
||
- self is not defined | ||
|
||
https://github.com/denoland/deno/issues/2639 | ||
see file_usage.js |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
onmessage = function (e): void { | ||
console.log(e.data); | ||
|
||
postMessage(e.data); | ||
// postMessage(e.data); | ||
|
||
workerClose(); | ||
// workerClose(); | ||
}; |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
const sort = (array) => { | ||
array.sort(); | ||
(array) => { | ||
array.sort(function (a, b) { | ||
return a-b; | ||
}); | ||
return array; | ||
}; |
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