Giter Club home page Giter Club logo

Comments (4)

squaremo avatar squaremo commented on August 27, 2024

You are right, that sounds very like the breakage due to me not using util#inherits (or the like), as reported in #35, #37 and #38, and supposedly fixed in 8b431bf and released in v0.2.1.

I'll have a closer look at your code and try it out.

Just to check:

  • are you using rabbit.js 0.2.1?
  • does it work in, e.g., Node.JS 10.3? (that's 10-series, but before the problems in those issues)

from rabbit.js.

squaremo avatar squaremo commented on August 27, 2024

I'm surprised that runs as-is, since it doesn't synchronise on the context being open (emitting 'ready').
If I stitch that in, the tests appear to run OK. That's with rabbit.js v0.2.1, and Node.JS 0.10.4 and 0.10.12.

  it('should open a publish stream', function(done){

    log('open')

    bus.rabbitContext.on('ready', function() {
      bus.publish('sometestpub', function(err, stream){
        log('stream', 'publish');
        stream.should.exist;
        stream.write("TEST TEST", 'utf8');
        done()
      })
    })
  })

from rabbit.js.

wolfeidau avatar wolfeidau commented on August 27, 2024

This did indeed resolve my issue, that said I think the challenge here is that, and correct me if i am wrong this "ready" event is only emitted once, so I pretty much have it around the first test and then assume in the next one that the context is in a ready state. I am not entirely keen on this, but having had a look at what you have to work with I understand with this limitations.

Originally I was trying to use the connect callback, but again this only fired on the first test, so the second would time out.

Cheers for taking the time to check it over for me, your guidance is much appreciated.

from rabbit.js.

squaremo avatar squaremo commented on August 27, 2024

Events and callbacks are almost no use for synchronisation, it is true. My adjustment was pretty crude -- just enough to delay the test run, given some assumptions (specifically that the test harness serialises tests).

I am now seeing some "send 'channel.open' seen" errors, in a different scenario. So I'm not sure it's entirely down to the problems fixed already. Stay tuned ...

from rabbit.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.