mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Refactor Worker and ThreadSafeState (#3242)
* Split ThreadSafeState into State and GlobalState. State is a "local" state belonging to "Worker" while "GlobalState" is state shared by whole program. * Update "Worker" and ops to use "GlobalState" where applicable * Move and refactor "WorkerChannels" resource
This commit is contained in:
parent
429439d198
commit
0049d4e50c
16 changed files with 557 additions and 414 deletions
|
@ -65,7 +65,6 @@ export function postMessage(data: any): void {
|
|||
export async function getMessage(): Promise<any> {
|
||||
log("getMessage");
|
||||
const res = await sendAsync(dispatch.OP_WORKER_GET_MESSAGE);
|
||||
|
||||
if (res.data != null) {
|
||||
return decodeMessage(new Uint8Array(res.data));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue