Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dennis Ploeger
    @dploeger
    I'm currently a bit stumped with Bluebird.all.
    I'm iterating over an array, but the promise is never resolved or rejected.
    Dennis Ploeger
    @dploeger
    Argh, sorry. Just found the error.
    I was returning a promise in a (reject, resolve) -Function. :)
    Patrick Malouin
    @pmalouin
    Hi, I seem to be getting a big performance regression when upgrading node from 6.11.3 to 8.5.0. The bottleneck seems to be around long stack traces, so not really critical in production. Did anyone else witness this problem? I'm using bluebird@3.5.0.
    'use strict';
    
    const bluebird = require('bluebird');
    
    const repeat = 100000;
    const array = [];
    for (let i = 0; i < repeat; i++) {
        array.push(0);
    }
    
    console.time('promiseSeries');
    bluebird.mapSeries(array, () => {
            return bluebird.resolve();
        })
        .then(() => {
            console.timeEnd('promiseSeries');
        });
    Goes from ~1.6s to 31s (with NODE_ENV=development).
    Patrick Malouin
    @pmalouin
    ok, just found related issue: petkaantonov/bluebird#1337
    Shlomi Levi
    @wizardnet972
    Hi, If I use async await in nodejs. do I need bluebird?
    Aliaksandr Yankouski
    @yankouskia
    @wizardnet972 it is the same question as "I use array iteration. do I need toforEach". It is just library to facilitate your work with promises, taking performance into account. So it's your decision.
    Gašper Gračner
    @gasperthegracner

    Hi everyone,
    In my application i am using bluebird and rxjs. I am trying to return bluebird promise as observable but i get a warning

    (node:34520) Warning: a promise was created in a handler at Users/gaspergracner/Projects/node_modules/rxjs/observable/PromiseObservable.js:66:36 but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.attempt.Promise.try (/Users/gaspergracner/Projects/node_modules/bluebird/js/release/method.js:29:9)

    this is what causes a problem:

    public getUserByUsername(username: string): Observable<any>  {
        let $obs = Observable.fromPromise(User.findOne({
          where: {
            username: username
          }
        }));
        return $obs;
      }

    Maybe you know how to avoid this warning?

    Dennis Ploeger
    @dploeger
    I have some sort of "style" question: Is it an anti-pattern to explicitely use "return Bluebird.resolve(<value>);" instead of just using "return <value>;"?
    I find it a bit more clearer to use that pattern, although the second one obviously works, too.
    Using the second one will give you problems when you're using Bluebird in Typescript, because the return type doesn't match.
    Paul Tiseo
    @paulxtiseo
    Given a .then(params => {});, I want to add a property to params, where the value is a promise that processes another property of params as argument. I'm having a hard time wrapping my head around this. For example, assume params is passed in as { prop1: [{},{},{}] } initially. I want to return a promise that eventually resolves to { prop1: [{},{},{}], prop2: ["","",""] }, where prop2 was evaluated from a promise that depended on prop1. How could I do this?
    DarkEthnic
    @RealDarkEthnic_twitter
    hello
    i am getting a problem with an event emitter giving me this error Unhandled rejection TimeoutError: operation timed out at afterTimeout (/home/ubuntu/workspace/node_modules/bluebird/js/release/timers.js:46:19) at Timeout.timeoutTimeout [as _onTimeout] (/home/ubuntu/workspace/node_modules/bluebird/js/release/timers.js:76:13) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5)
    Bnaya Peretz
    @Bnaya
    issue(?) with map() index parameter gives me a series like that:
    0,5,4,3,2,1
    Starts with zero, and then counting down from the end
    David Luzar
    @dwelle
    @Bnaya can you paste the code?
    Andrew
    @Andrey_Yerdna_twitter
    i have strange work of Promise.all. I want to insert in base 10k notes, but fetch only 10. node 7.10.1 bluebird 3.5.1
    let fetchbase = [];
    for (var i = 0; i < res.length; ++i) {
         fetchbase.push(insertDB('INSERT INTO city SET ?', res[i]));
     };
    return Promise.all(fetchbase);
    
    let insertDB = (sql,arr) => {
        return new Promise(function(resolve, reject) {
            Db.getPool().then(function(connection){
                connection.query(sql,arr,function(err,result) {
                    if (err) {
                        throw err;
                        console.log(err);
                    };
                    console.log(result.insertId);
                    resolve(result.insertId);
                });
            });
        });
    }
    avimar
    @avimar
    Can someone tell me what the heck is going wrong?
    I'm doing a query to mongodb (toArray()), as values of an object.
    But when I do Promise.props, I end up with something like Promise{ [values...]} and it fails Array.isArray. What happened....?? Totally confused here.
    item: Promise { [] }
    well, adding .then(fp.mapValues(fp.toArray)) works...
    Adel
    @AdelMahjoub
    does the bluebird sing ?
    Steve Cox
    @stevejcox
    Hi All.. I am having an issue with Promise.filter, could someone advise?
    fratting
    @fratting
    Hi. I'm using bluebird with aurelia and only in firefox we get an illegal character error in bluebird.min.js v3.5.1 when it loads. IE and Chrome are fine. Has anyone experienced this with firefox?
    fratting
    @fratting
    @fratting Appears to be a variety of problems, one of which is the tryCatcher function executing a function called 'bound error'. the target var is the source of the illegal character. Another instance is the console.warn at like 1546 of the unminified bluebird.js file. console is considered an illegal character. Odd and only with firefox
    Martijn Poelman
    @mpoelman
    Can someone point me in the right direction using bluebird promises in Aurelia? I have tried tons of methods but I keep getting the same type of errors (bluebird has no export default 'Promise', compiler error: duplicate key 'Promise' and such)
    Also, "Promise.config is not a function", and "Promise is not a constructor"
    Ziad El Khoury Hanna
    @zaygraveyard
    What is the license for the code snippets in the Bluebird's Wiki, more specifically the Optimization killers?
    Thank you
    Owen Garland
    @bag-man
    Where is best to ask for some clarification on a bluebird functions flow?

    Basically was hoping Promise.map().then() would run after all the mapped promises, however the then is running immediately.

    https://gist.github.com/bag-man/4b5db93b3c9c5e38876946d36c89331f#file-import-js-L32-L45

    So I would hope for the indexes to be built after the save operations, but it's happening immediately.
    Ziad El Khoury Hanna
    @zaygraveyard
    @bag-man you are using it correctly, but the mapper function should return a promise; It currently returns nothing (or undefined) which means that all the promises are resolved with undefined and so the then is running immediately
    Owen Garland
    @bag-man
    Ahhhh I see, let me try that :)
    Beautiful, that was it, thank you so much! The pain that has saved me :D
    Ziad El Khoury Hanna
    @zaygraveyard
    @bag-man Great :smile:
    Owen Garland
    @bag-man
    I'd been banging my head on this script for a week, and just sorted it in like two hours. Shows what a good nights sleep can do! Right I shall be off, thanks again!
    David Schwartz
    @dbschwartz
    Hey everyone, I am trying to make an objects of objects from promise values. What I'd like to do is have an object with multiple objects, and from there have multiple objects pointed at other objects that are pointed at promise.props. Does anyone know of a way to do this?
    Krishnan Subramanian
    @krishnanms
    Hi #channel .. are bluebird promises safe to use with async/await .. i.e. can I use await on a bluebird promise ?
    Roberto Di Lillo
    @koop4
    Hi guys, is anyone able to address me to the proper resourses to promisify my mysql in node?
    Eric Eastwood
    @MadLittleMods
    Roberto Di Lillo
    @koop4
    @MadLittleMods sorry for the late late late reply, after trying on and on I actually made it and forgot to write here :)
    thanks guys :)
    Eric Eastwood
    @MadLittleMods
    @koop4 What was your solution? Best to post it so future onlookers can reference it
    LYF
    @pod4g
    Hi. there is a statistical analysis tool for performance testing https://github.com/pod4g/hiper/
    Roberto Di Lillo
    @koop4
    Hi guys, I'm trying to understand cooroutine but there must be something i'm not understanding xD
    here's my "not" working example:
    resultSet.map( item => {
          Promise.coroutine( function* (user) {
            let opt = { 
              TableName: 'tableName',
              KeyConditions: {  
                username: {
                  AttributeValueList: [user],
                  ComparisonOperator: 'EQ'
                }
              },
              ProjectionExpression: 'firstname, lastname',
            }
            let userFriends = yield dynamodb.queryAsync(opt)
            /*  random code here to assign first name and last name to item */ 
          })(item);
    
        return item 
    });
    Dany
    @danyextreame_twitter
    Hey, I just realized today that in bluebird 3.5.2 Promise.race is disabled. How can I access this function, or is there a different way of using it?
    Eric Eastwood
    @MadLittleMods
    @danyextreame_twitter Are you sure? I don't see any notice in the docs and seems to work fine with a quick test in https://npm.runkit.com/bluebird
    Phuong Nguyen
    @neunygph
    Anyone has experience setting jwplayer with AWS RMTP?