Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6807315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:49:02+00:00 2026-05-26T19:49:02+00:00

I am using zeromq to solve a problem which involves several hundred (potentially thousands)

  • 0

I am using zeromq to solve a problem which involves several hundred (potentially thousands) clients request tasks to be carried out. Each client would request for a specific task to be carried out, and the result(s), when completed, whould be returned back to the client that issued that request.

These are the actors that I have identified so far, in the pattern I have come up with:

  • Client: this is the actor that requests a unit of work (or ‘job’) to be carried out
  • Controller: this is the actor that loadbalances the ‘jobs’ accross available engines
  • Engine: this is the actor that receives a job request from the controller and publishes the result back to the client.

I still haven’t yet worked out how the engine gets the mesage back to the client. I am guessing that one way for this to be implemented using zeromq would be:

Client:
PUSH job messages on one socket to Controller SUBscribe to completed results on PUBlished by Engine, on another
socket

Controller:
PULL job messages from client on one socket PUBlish job messages to engines on another socket (clearly, this will be a forwarding device)

Engine:
SUBscribe to job messages on one socket PUBlish result to another socket

It would be most helpful if someone provide a skeleton/snippet which will show the outline of how this pattern may be implemented, using the zeromq framework.

The code snippet can be in C, C++, PHP, Python or C#

[[Edit]]

After reading up on Task Farms (as suggested by akappa). I think this problem can indeed be modelled by a Task Farm. I have modified my original actors accordingly (and changed the title too).

It would still be very useful if someone who is familiar with zeromq, can sketch out a skeleton that would show how I can use the core components to build such a framework.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:49:03+00:00Added an answer on May 26, 2026 at 7:49 pm

    There are a variety of approaches to this, and IPython.parallel includes two such implementations with ZeroMQ – one simple and pure-zmq, and another that is more elaborate, with the Controller implemented in Python.

    We split the Controller into two actors:

    1. Hub – an out-of-the-way process that sees all traffic, and keeps track of the state of the cluster, pushing results to a database, etc., notifying clients about engine connect/disconnect, etc.
    2. Scheduler – at its core, a simple ROUTER-DEALER device that forwards requests from the client(s) to the engines, and the replies back up.

    Looking at just the task-farming part of our topology:

    • Scheduler is a 0MQ Queue device, with a ROUTER and DEALER socket, both of which bind.
    • Clients have DEALER sockets, connected to the Scheduler’s ROUTER
    • Engines have ROUTER sockets connected to the Scheduler’s DEALER

    Which makes use of these two properties:

    • DEALERS LRU load-balance requests across peers
    • ROUTERs use identity prefixes to send replies back to the peer that made a particular request.

    A toy load-balanced task farm with pyzmq, which routes replies back up to the requesting client: https://gist.github.com/1358832

    An alternative, where the results go somewhere, but not back up to the requesting client, is the Ventilator-Sink pattern in the 0MQ Guide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started using ZeroMQ this week, and when using the Request-Response pattern I am
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using android 2.3.3, I have a background Service which has a socket connection. There's
Using jQuery, one can easily find out whether a particular element is visible using
Using a ZMQ.SocketType.REP (reply) messaging socket with ZeroMQ, I am receiving messages and then
I am trying to use ZeroMQ / ØMQ / 0MQ (which ever you prefer)
Using Tsql, how can I find out when MS SQL server was installed?
I can't get ZeroMQ C++ wrapper to receive multipart messages. The same code using
I am using a standard LRU queue as defined by the ZeroMQ guide figure
I am trying to build a helloworld example for zeromq using the C# binding.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.