Hi everyone,
First of all I love zeromq, but I never used it on a productive scale until
now.

Now I built a distributed system for printing labels. (Mainly for 38c3, but
it will be built into a real application)

There are servers for every kind of printer and server is responsible for
one instance at a time. As I am using cups for to execute print jobs I
could optimize this, but I don't for some other reasons.

There is a central server that maintains the current jobs and their status.
It does not have any interface other than zeromq.

And there is a frontend web api, but that one only takes json objects,
minifies them and pushes them to the central job server.

Until now I had req/rep sockets as everything, but now as I'm refactoring
most of my code I need some help wrapping my head around how I would
structure my sockets.

For the print servers I planned to have 3 sockets:

Command&Control: Rep
As a general management interface so I can change settings, enable the
other types of sockets if needed and "manually" queue jobs. I can stop or
restart the servers too. Also I can manage the job queue from there. And to
check if the server is still working correctly and have a heartbeat.

JobStream: Pull
For a central coordinator like my job server to just push new jobs to one
or multiple servers. I want to do this, so huge jobs can be paralelized. I
have an application at work for it (printing labels from netbox with jobs
of 100 to 1000 labels each).

UpdateStream: Push
A way to push updates about the job statuses back to the job server. If a
job is received a message gets pushed with the state "accepted" when it
gets added to the queue a message gets pushed with "queued" when a job is
submitted to cups a message gets pushed with "inProgress". When cups
finished the job a message gets pushed with "completed"
And finally if the job is removed from the queue a message with "removed"
is pushed. If a job fails "failed" is pushed and if the job got aborted via
the cnc socket "aborting" gets pushed. If an aborted job finally is removed
from the cups queue "aborted" is pushed.

I am doing that, so the job server can monitor the jobs and maybe reissue
jobs if necessary. And so I can have a web interface showing the jobs if I
want to.

The job server will have the matching sockets per printer type, but can
have multiple instances of the same printer type.

I want to be able to set up two servers for brother ql printers that have
different label types I.E. One with endless 62 mm red and black labels, one
with endless 62 mm black and white labels, one with round 24mm labels and
one with die cut 62x100mm labels. The printer servers are configured with
the label type the service and the server can be interrogated about it.

In that case I want the job server to issue commands to the servers to
enable jobStream on different ports for every type of label, so it can have
different push sockets per label type. But all the update streams are
connected to only one pull socket on the job server.

Does that make any sense to you and do you have any input for me that would
make my structure simpler?

Best regards
Stefan
_______________________________________________
zeromq-dev mailing list
[email protected]
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to