1.0.0-rc6 • Published 2 years ago

@eyalsh/worker_sync v1.0.0-rc6

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

Worker Sync

Latest Version Test codecov nodejs minimum version License: GPL v3

JavaScript synchronization functions (mutex, semaphore) between workers (and the main thread).

Setup

NodeJS

Released under both npmjs & github packages:

npmjs.com:@eyalsh/worker_sync github.com:@Eyal-Shalev/worker_sync

Install:

npm install @eyalsh/worker_sync
yarn add @eyal-shalev/worker_sync

import (ES Modules):

import { Mutex, Semaphore } from "@eyalsh/worker_sync";

require (CommonJS):

const { Semaphore, Mutex } = require("@eyalsh/worker_sync");

Deno

The library is available to import from deno.land/x/worker_sync

import { Mutex, Semaphore } from "https://deno.land/x/worker_sync/mod.ts";

Browser - Download

You can download compiled library from GitHub:

import { Mutex, Semaphore } from "/path/to/worker_sync.esm.min.js";

Note: a bundled IIFE version also exist, if your application doesn't support ES modules.

<script src="/path/to/worker_sync.iife.min.js"></script>
<script>
  const {Semaphore, Mutex} = worker_sync;
</script>