Giter Club home page Giter Club logo

Comments (11)

bearnard avatar bearnard commented on May 26, 2024

any update on this?

from txzmq.

smira avatar smira commented on May 26, 2024

You should do mode push in "connect" mode and pull in "bind" mode. Otherwise you end up with no clients on bind.

from txzmq.

DavidJFelix avatar DavidJFelix commented on May 26, 2024

That's not true at all... bind push and connect pull is a very widely used ZMQ system... in fact it's the third listed in the guide:

http://zguide.zeromq.org/page:all#Divide-and-Conquer

And a link to the code
http://zguide.zeromq.org/py:taskvent

You start all of your workers/pullers first regardless of whether or not the pusher is bind or connect.

from txzmq.

smira avatar smira commented on May 26, 2024

Sorry for not being clear enough. You can use push/pull with any combination of bind/connect, but for this particular example it doesn't work.

Sending (pushing) to 'bind' socket without pull consumers would result in EAGAIN from ZMQ, and txZMQ doesn't do queueing on its own. This is what happened in the issue description.

from txzmq.

DavidJFelix avatar DavidJFelix commented on May 26, 2024

If I connect with multiple (or one) pull consumers first and then bind with a push producing on an interval of one second, I still get EAGAIN from the example. So even though it's quite capable of consuming them quicker than they are produced, they won't be.

from txzmq.

smira avatar smira commented on May 26, 2024

You would get EAGAIN unless pull consumer is connected. Connection doesn't happen simultaneously.

I've pushed change to examples to skip such sends.

from txzmq.

DavidJFelix avatar DavidJFelix commented on May 26, 2024

I'm getting EAGAIN when a pull consumer is connected. I have 12 pull consumers connected and the interval is 1 second on the push. There's no way that one isn't connected at send. In bind-pull/connect-push, 1 consumer can handle sends 100x this (interval of 0.01 seconds)

from txzmq.

smira avatar smira commented on May 26, 2024

Please try adding try/except as in 39e841a, and see what happens. First send in this example happens not after 1 second, but immediately.

from txzmq.

DavidJFelix avatar DavidJFelix commented on May 26, 2024

Alright, so I just tested it as-is with 1 second interval (in the reactor.callLater call) and with a 0.01 interval. It seems like it successfully produced and consumed a call every time, but regardless of interval, the second logged call is always the "Skipping, no pull consumers..." which seems like it's not correct, since the first listed item and the third listed item are separated by 1x interval, not 2x like they should be if a call failed to find pullers. I'm just wondering what's causing that initial EAGAIN, which I think is erroneous.

from txzmq.

smira avatar smira commented on May 26, 2024

I don't see your code, so it's actually hard to tell what's going on. That EAGAIN is coming from ZMQ itself, not from the txZMQ wrapper. In synchronous version it would just block, txZMQ is async so it just errors back to the caller. You may decide whether you would like to queue outgoing messages, drop them or do anything else.

from txzmq.

DavidJFelix avatar DavidJFelix commented on May 26, 2024

I'm still using the push_pull.py example. I have a couple terminal windows open and I'm using typical command line arguments to set up one bind pusher and either one or a few connect pullers. If you do this, the second logged entry for the producer/pusher is always the EAGAIN fail message. I think this may be caused by the way that the example is setup, however. Give me a minute and I'll try a solution I think may work.

from txzmq.

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.