Giter Club home page Giter Club logo

message-ports's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rstuven

message-ports's Issues

Allow explicit bind/connect on push,pull,req and rep socket types

Thanks to @rstuven for pointing this out in #1.

Currently, this code

pull  = mp.pull 3000
push1 = mp.push 3000
push2 = mp.push 3000

Will cause the the pull socket to bind to port 3000 and the push sockets to connect to port 3000. The pull socket will buffer incoming messages and then process them fairly - i.e. one from push1 then one from push2 then one from push1 etc. This strategy of processing messages from the incoming buffer is called fair queuing.

ZeroMQ also allows the opposite configuration. Where the the push sockets bind and the pull socket connects. Messages will still flow in the same direction (form push to pull) but in this case the push sockets buffer their outgoing messages and the pull socket asks for them in a fair manner - i.e. it asks push1 for a message then it asks push2 then it asks push1 etc. This strategy of asking for messages fairly goes by round robin.

I think having the pull socket bind should remain the default but explicitly specifying whether you want the socket to bind/connect should be possible with:

# default behavior
pull  = mp.pull.bind 3000
push1 = mp.push.connect 3000
push2 = mp.push.connect 3000

# reversed
pull  = mp.pull.connect 3000, 3001
push1 = mp.push.bind 3000
push2 = mp.push.bind 3001

The same goes for request/reply sockets.

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.