Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
buffered-async-iterable
Advanced tools
Readme
Buffered parallel processing of async iterables / generators.
import { bufferedAsyncMap } from 'buffered-async-iterable';
async function * asyncGenerator() {
yield ...
}
const mappedIterator = bufferedAsyncMap(asyncGenerator(), async (item) => {
// Apply additional async lookup / processing
});
for await (const item of mappedIterator) {
// Consume the buffered async iterable
}
import { bufferedAsyncMap } from 'buffered-async-iterable';
const mappedIterator = bufferedAsyncMap(['foo'], async (item) => {
// Apply additional async lookup / processing
});
for await (const item of mappedIterator) {
// Consume the buffered async iterable
}
import { bufferedAsyncMap } from 'buffered-async-iterable';
const mappedIterator = bufferedAsyncMap(['foo'], async function * (item) => {
// Apply additional async lookup / processing
yield ...
yield * ...
});
for await (const item of mappedIterator) {
// Consume the buffered async iterable
}
Iterates and applies the callback
to up to bufferSize
items from input
yielding values as they resolve.
bufferedAsyncMap(input, callback[, { bufferSize=6, ordered=false }]) => AsyncIterableIterator
input
– either an async iterable, an ordinare iterable or an arraycallback(item)
– should be either an async generator or an ordinary async function. Items from async generators are buffered in the main buffer and the buffer is refilled by the one that has least items in the current buffer (input
is considered equal to sub iterators in this regard when refilling the buffer)bufferSize
– optional – defaults to 6
, sets the max amount of simultanoeus items that processed at once in the buffer.ordered
– optional – defaults to false
, when true
the result will be returned in order instead of unorderedMerges all given (async) iterables in parallel, returning the values as they resolve
mergeIterables(input[, { bufferSize=6 }]) => AsyncIterableIterator
input
– an array of async iterables, ordinare iterables and/or arraysbufferSize
– optional – defaults to 6
, sets the max amount of simultanoeus items that processed at once in the buffer.FAQs
Creates a prefetched async iterable
We found that buffered-async-iterable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).