Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Yaw Etse
    @yawetse
    @nikkitan I’ll message you separately but that’s exact what promisie does. It has many of the same async library utility functions but for promises
    Konstantin Kostiuk
    @SET001

    in this scenario

    eachSeries(webhooks, async (webhook) => {
          await Promise.reject();
        }, (e) => {
          //  error handler
        })

    why error handler does not triggered?

    Konstantin Kostiuk
    @SET001
    oh, it shold be like that await Promise.reject(new Error());
    Vamshi Gudavarthi
    @gudavarthi93_twitter
    Hi, I am new to Async and I want to know to how to resolve the following problem. I have an async.series and an array of functions are passed in as input and there is one function in that where I need to invoke async.eachOfSeries, but async.eachOfSeries gets called only once for any array.
    I am assuming that async.series gets connected through invoking callback functions and same thing for async.eachOfSeries but each of these have their own callbacks to be invoked which is where I think the problem arises. ANy Ideas ?
    Paskalouis Patressi
    @Paskalouis
    Hi, I just upgrade async from 2.1.4 to the latest. Is there any breaking changes ? Because my code on forEachSeries and forEachOfSeries, last callback is callback is not defined, like delayed.
    atrok
    @atrok
    Folks, question about using async queues - i have 2 workers each doing its own stuff, and one depends on results of other. Both workers do some heavy stuff, and if run in a loop easily overwhelm the system. I hoped to run these workers in 2 queues, limiting the number of simultaneously executed workers. The task submitted to one queue once accomplished would push the second task to second queue, and both would execute its tasks in parallel. However, it has appeared that second queue wouldn't start execution of its tasks until first queue was done doing its own tasks. Why is that? Is it intended by design, or I'm missing something?
    abuzarhamza
    @abuzarhamza
    Hi Folks .. one small question I need a small info for th usage of autoInject
    Here my code in the gist https://gist.github.com/abuzarhamza/03724d121f41bd410ba45a7bbbf97bff .. I have seen some time few people use currying to pass callback , Is it a good practice or should I use call?
    Rudraksh MK
    @rudimk
    Hi there! I'm trying to hack async.js to run as the core of a workflow engine, where task definitions are essentially async.js function calls.
    I'm wondering if there's some kind of serialization method where a series of async.js calls can be serialized into a particular format - like JSON, for instance.
    Not sure if my question there makes sense, apologies!
    Peter Bocan
    @PeterBocan
    Hey guys, I wonder how to correctly use async.mapLimit if I want return the list within a promise.then(...);
    I have something like this
    fetch(...)
       .then((results) => { 
         let list = ...
         async.mapLimit(list, async  (item) => ... ); 
         return ... ?
        /// ???     
      });
    Async doesn't return promises, can I use promisify?
    Peter Bocan
    @PeterBocan
    Anyway, is there a way, how to return the partial list even after there's an error from within mapLimit?
    Daniel Kats
    @boompig
    Hi all, quick question
    If I want to build the dist from source, how would I do that?
    I didn't see any instructions in the readme
    Chris Wells
    @chriswells0
    Can async be used to wait for an async function's callback before continuing code execution?
    Joe Gornick
    @jgornick
    Hey folks, can I proivde a promise as a collection to a method like eachSeries?
    cindyshapiro
    @cindyshapiro
    Can async.series be used with express?
    I've been using the library for a while now and I love it. It's incredibly elegant. But when I tried to use it within an app.get, it didn't wait for each function in the series to finish. It just moved on to the next one in the series and completely blew up my sequence. Thoughts?
    Alexei Kozhushkov
    @joystick
    Hello, need some help with async.queue please. Inside the worker function I have to wait on event coming from net socket. Is there any recipe how to do this? Thanks!
    adventl
    @adventl

    Hello, how do I use async.queue in a sequential manner?

    I've read that for a static array of tasks, sequential execution can be achieved through async.series, if one requires push/pop, one should use queue instead. I've set up my queue as

    const RequestQueue = queue(() => {}, 1);

    but the 2nd item (a fetch request) always executes before the 1st item (also a fetch request) finishes.

    Sample Task:

     retrieveConnectionsTask = () => {
            RequestWrapper.get("/myEndpoint")
                .then(response =>
                    response.json()
                )
                .then(data => {
                    //doSomethingWithData
                    console.log("retrieveConnectionsTask Returned");
                    console.dir(this.state.connections);
                })
                .catch(error => console.log(error));
        };

    would appreciate any advice.

    Thank you!

    Cory Mawhorter
    @cmawhorter
    has anyone had any problems using async w/rollup? i've started seeing Cannot read property \'isAsync\' of undefined using parallelLimit but all the functions are asyncfunctions. i also tried wrapping them in asyncify but that didn't work either
    Nicolas Vanhoren
    @nicolas-van

    Hello everyone.

    You might be interested by an open-source project I recently started which is basically a rewrite of Async.js but aimed for exclusive usage of async/await and promises.

    The code is here: https://github.com/nicolas-van/modern-async

    I would welcome any comment.

    Conrad Buck
    @conartist6
    I also have been working on a replacement for some (but not all) parts of async. Mine is iter-tools, and it only focuses on iterables, but I think it has significant advantages. It ensures resources are released (by calling iterator.return() if it is present), it has a better approach to parallelization, and it offers more performant implementations of methods over sync iterators. In 8.0 I plan to change my methods around a bit so that import { asyncMap } from 'iter-tools' beceomes import { map } from 'iter-tools/async', which I think will be more familiar to users of this library.
    Garrett Jensen
    @jensengar
    Hey guys, I'm working on a pr to work around some of the throttling issues with setImmediate which becomes setTimeout in the browser. I'm having a hard time building the lib for testing though, even from a vanilla repo. What I've done:
    • Checkout the repo
    • install deps
    • run make
    That results in the following:
    make: *** No rule to make target `build/all.js', needed by `build-modules'.  Stop.
    I didn't see a contributing guide or anything like that, am I missing some setup steps?
    sschneider
    @sschneider:matrix.org
    [m]
    good morning
    Is there a tutorial on how to use async queue correctly? I seem to have abused the error callback to trigger tasks :D
    or since @nicolas-van you are promoting your lib, can you give me an example for an async queue :D
    sschneider
    @sschneider:matrix.org
    [m]
    or maybe I better say what i'm trying to do, maybe queue is the wrong thing. I want to fire async api calls but to not DDoS the DB I want to fire only some at a time and queue the rest for after those have finished
    and I also want to merge the results of the api calls
    sschneider
    @sschneider:matrix.org
    [m]
    where is the difference between queue und cargoQueue?
    sschneider
    @sschneider:matrix.org
    [m]
    what exactly is a task btw? is it just meta info about a task or is it a function that is executed?
    Baptiste Garcin
    @Ernest_Jones_gitlab
    Hi, I am trying to use caolan/async with typescript and promise. I am facing this error and I just don't get how am I suppose to fix it
    image.png
    Conrad Buck
    @conartist6
    Looks to me like a bug in the typedefs. Your code works right?
    Conrad Buck
    @conartist6
    Oh dear, I see. This was originally callback-based async, and promise support was added to the library but seemingly not the typedefs. Also the promise support seems super janky, for some reason the docs say that you can't use promise-returning functions as callbacks, only actual async functions. See: https://caolan.github.io/async/v3/index.js.html#line1
    Conrad Buck
    @conartist6
    If you don't want to end up trying to fix that yourself, you could always come use iter-tools : )
    Baptiste Garcin
    @Ernest_Jones_gitlab
    Ok, same diagnostic here. I finally fixed it by using async.asyncify. I will check out iter-tools. I am looking for a fine way to control the flux in my promised-based operations…
    image.png
    Conrad Buck
    @conartist6
    Huh I forgot that async is fully parallel by default. That does make it very well suited to running exactly that kind of code.
    Baptiste Garcin
    @Ernest_Jones_gitlab
    Promise.all is also parallel by default. Where async shine is for more complex flux and for the concurrency it provides.
    Here, i am using async simply because the syntax is clearer than promise.all