quackingduck-archive / message-ports Goto Github PK
View Code? Open in Web Editor NEWSockets from the future. A friendly API over the node ZeroMQ (zmq) bindings
License: MIT License
Sockets from the future. A friendly API over the node ZeroMQ (zmq) bindings
License: MIT License
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.