callback-to-async-iterator - Turn any callback-based listener into an async iterator.

  •        16

Turn any callback-based listener into an async iterator. The problem is that callbacks are push based, they push values to the listener whenever a new value is availabe. Async Iterators on the other hand are pull based, they request a new value and wait until it is available.

https://github.com/withspectrum/callback-to-async-iterator

Dependencies:

iterall : ^1.0.0

Tags
Implementation
License
Platform

   




Related Projects

IxJS - The Interactive Extensions for JavaScript

  •    TypeScript

The Interactive Extensions for JavaScript (IxJS) brings the Array#extras combinators to iterables, generators, async iterables and async generators. With the introduction of the Symbol.iterator and generators in ES2015, and subsequent introduction of Symbol.asyncIterator and async generators, it became obvious we need an abstraction over these data structures for composition, querying and more.IxJS unifies both synchronous and asynchronous pull-based collections, just as RxJS unified the world of push-based collections. RxJS is great for event-based workflows where the data can be pushed at the rate of the producer, however, IxJS is great at I/O operations where you as the consumer can pull the data when you are ready.

axax - Async Iterator Extensions for JavaScript e.g. map, reduce, filter, flatMap, etc.

  •    TypeScript

A library of async iterator extensions for JavaScript including map, reduce, filter, flatMap, pipe and more. Async iterators are a useful way to handle asynchronous streams. This library adds a number of utility methods similar to those found in lodash, underscore, Ramda or RxJs.

async - Async utilities for node and the browser

  •    Javascript

Higher-order functions and common patterns for asynchronous code

chillout - Reduce CPU usage in JavaScript

  •    Javascript

Reduce JavaScript CPU usage by asynchronous iteration. Provides asynchronous iteration functions that have a Promise based interface and it can execute with low CPU usage. Each iteration adds delay if the processing is heavy to maintain the CPU stability. Iterate without delay if processing is fast. Therefore, it will realize friendly processing for your machine. It can execute JavaScript without "Warning: Unresponsive Script" alert in the browser.

suspend - Callback-free control flow for Node using ES6 generators.

  •    Javascript

Generator-based control-flow for Node enabling asynchronous code without callbacks, transpiling, or selling your soul. Suspend is designed to work seamlessly with Node's callback conventions, promises, and thunks, but is also compatible with code that follows other conventions.


callbag-basics - 👜 Tiny and fast reactive/iterable programming library

  •    Javascript

Basic callbag factories and operators to get started with. Callbag is just a spec, but callbag-basics is a real library you can use. Imagine a hybrid between an Observable and an (Async)Iterable, that's what callbags are all about. In addition, the internals are tiny because it's all done with a few simple callbacks, following the callbag spec. As a result, it's tiny and fast.

zsh-async - Because your terminal should be able to perform tasks asynchronously without external tools!

  •    Shell

With zsh-async you can run multiple asynchronous jobs, enforce unique jobs (multiple instances of the same job will not run), flush all currently running jobs and create multiple workers (each with their own jobs). For each worker you can register a callback-function through which you will be notified about the job results (job name, return code, output and execution time). zsh-async is a small library for running asynchronous tasks in zsh without requiring any external tools. It utilizes zsh/zpty to launch a pseudo-terminal in which all commands get executed without blocking any other processes. Checking for completed tasks can be done manually, by polling, or better yet, automatically whenever a process has finished executing by notifying through a SIGWINCH kill-signal.

dropstore-ng - Dropbox Datastore bindings for AngularJS

  •    Javascript

The bindings wrap the first three tiers (Client, DatastoreManager, Datastore) of the Dropbox Datastore API within Angular Promises. This is because only the first three tiers use callbacks and because it creates a easy to follow chain of async function calls rather than the hell usually associated with callback heavy libraries. The Dropbox Datastore API is also wrapped with promises to create a simple way to ensure that the AngularJS scope is updated properly. dropstore-ng also provides AngularJS publish/subscribe functionality allowing applications to listen for local and/or remote updates to the datastores. Check out the example-todo branch for more the live demo code.

do - Do is a simple library for managing async actions in node.JS.

  •    Javascript

Do expects async functions to not require the callback in the initial invocation, but instead return a continuable which can then be called with the callback and errback. This is done by manually currying the function. The "continuable" is the partially applied version of the function returned by the outer function. The body of the function won't be executed until you finish the application by attaching a callback.This style is extremely simple (doesn't require an external library like promises to use), and is fairly powerful.

proposal-async-iteration - Asynchronous iteration for JavaScript

  •    HTML

The iterator interface (introduced in ECMAScript 2015) is a sequential data access protocol which enables the development of generic and composable data consumers and transformers. Their primary interface is a next() method which returns a { value, done } tuple, where done is a boolean indicating whether the end of the iterator has been reached, and value is the yielded value in the sequence. Since both the next value in the sequence and the "done" state of the data source must be known at the time that the iterator method returns, iterators are only suitable for representing synchronous data sources. While many data sources encountered by the JavaScript programmer are synchronous (such as in-memory lists and other data structures), many others are not. For instance, any data source which requires I/O access will be typically represented using an event-based or streaming asynchronous API. Unfortunately, iterators cannot be used to represent such data sources.

tamejs - JavaScript code rewriter for taming async-callback-style code

  •    Javascript

JavaScript code rewriter for taming async-callback-style code

mmmagic - An async libmagic binding for node.js for detecting content types by data inspection

  •    C++

An async libmagic binding for node.js for detecting content types by data inspection.detectFile(< String >path, < Function >callback) - (void) - Inspects the file pointed at by path. The callback receives two arguments: an < Error > object in case of error (null otherwise), and a < String > containing the result of the inspection.

knex - A SQL query builder that is flexible, portable, and fun to use!

  •    Javascript

Knex.js is a "batteries included" SQL query builder for Postgres, MSSQL, MySQL, MariaDB, SQLite3, and Oracle designed to be flexible, portable, and fun to use. It features both traditional node style callbacks as well as a promise interface for cleaner async flow control, a stream interface, full featured query and schema builders, transaction support (with savepoints), connection pooling and standardized responses between different query clients and dialects.

aqua - :bulb: A website and user system starter

  •    Javascript

Boilerplates can be a huge time sink to maintain and I've decieded to archive this project. I started the work for upgrading to hapi v17 and using async/await instead of callbacks, that work can be found in the hapi-17-async-await branch.

continuation - A compiler for JavaScript asynchronous Continuation-Passing Style transformation

  •    Javascript

Continuation.js is a compiler for Continuation-Passing Style transformation, which simplifies asynchronous JavaScript programming. It translates slightly flavored JavaScript syntax into standard JavaScript, so it can be also called a "translator". Continuation.js introduces a virtual function cont, which allow you to write continuation-passing style code (or asynchronous callback style code) far easier. cont is not a actual function, but a mark with the same syntax to function calls in JavaScript. By using Continuation.js you can write asynchronous control flows like flat threaded code, and it compiles it into continuation-passing style code. The code above is flatted by using the virtual function cont. Control flow must "wait" for the return of asynchronous function call fs.readFile. Parameters in the argument list of cont will be set after it returns. "Return" here is a little confusing because in an asynchronous function "return" means callback function called, not "return" in the literal sense. An asynchronous function usually returns immediately (by encountering return statement or the end of the function scope) while the callback function could be called later. You can be understood as all the statements after cont until the end of the function are the callback function of the asynchronous function call. The code feels like threaded code, but it is still asynchronous while executing.

ea-async - EA Async implements async-await methods in the JVM.

  •    Java

EA Async implements async-await methods in the JVM. It allows programmers to write asynchronous code in a sequential fashion.

queue - Asynchronous function queue with adjustable concurrency

  •    Javascript

Asynchronous function queue with adjustable concurrency. This module exports a class Queue that implements most of the Array API. Pass async functions (ones that accept a callback or return a promise) to an instance's additive array methods. Processing begins when you call q.start().

continuable - C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)

  •    C++

Issue reports are accepted through the Github issue tracker as well as Pull requests. Every contribution is welcome! Don't hesitate to ask for help if you need any support in improving the implementation or if you have any troubles in using the library.