Skip to content

Inspired by Go & Clojure Channels, async_channels provides channels as an asynchronous communication method between asynchronous functions.

License

Notifications You must be signed in to change notification settings

Eyal-Shalev/async_channels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async Channels

Latest Version Test & Release codecov nodejs minimum version License: GPL v3

Channels are queue-like objects (First In First Out) that their enqueue (send) and dequeue (get) functions are asynchronous (async). By passing them between asynchronous functions we can synchronize operations between said functions.

Setup

NodeJS

Released under both npmjs & github packages:

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

Install:

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

import (ES Modules):

import { Channel } from "@eyalsh/async_channels";

require (CommonJS):

const { Channel } = require("@eyalsh/async_channels");

Deno

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

import { Channel } from "https://deno.land/x/async_channels/mod.ts";

Browser - CDN / Download

You can import the library from any CDN that mirrors npmjs.com, such as skypack.dev or unpkg.com.

import { Channel } from "https://cdn.skypack.dev/@eyalsh/async_channels";

Or you can download compiled library from GitHub:

  • Latest Release
  • All Releases
import { Channel } from "/path/to/async_channels.esm.js";

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

<script src="/path/to/async_channels.iife.js"></script>
<script>
  const {Channel} = async_channels;
</script>

Examples

About

Inspired by Go & Clojure Channels, async_channels provides channels as an asynchronous communication method between asynchronous functions.

Topics

Resources

License

Stars

Watchers

Forks