Skip to content

ØMQ (zeromq) isn't quite working #10

Description

@remy

TL;DR - please have a look at my zeromq setup - it's wrong and needs fixing - help me Obi-Wan....


I'm using zeromq to post off the job of parsing all the CSS in a url, and then once it's complete, it passes the message back to the the main app.js node process.

Ideally, lots of requests could come in, and I could be running 2-4 worker processes (node prefix.js) and requests would queue up, get processed, and returned to the correct waiting http client.

My problem (aside from having never used zeromq or any queuing system for that matter) is that the job is passed off to the worker, but because (I think) I have an odd one-to-one queue set up, the same job gets returned to all of the clients.

It's tricky to replicate, because you need concurrent request - but here's an example:

curl "http://cssprefix.com/check.json?http://remysharp.com"; \
curl "http://cssprefix.com/check.json?http://jsconsole.com"; \
curl "http://cssprefix.com/check.json?http://remote-tilt.com"

{"pass":true}
{"pass":false,"lint":{"type":"warning","line":834,"col":3,"message":"The property -ms-transition is compatible with -webkit-transition, -moz-transition, -o-transition and should be included as well.","evidence":"  -webkit-transition: opacity 200ms;\r","rule":{"id":"compatible-vendor-prefixes","name":"Require compatible vendor prefixes","desc":"Include all compatible vendor prefixes to reach a wider range of users.","browsers":"All"}}}
{"pass":false,"lint":{"type":"warning","line":834,"col":3,"message":"The property -ms-transition is compatible with -webkit-transition, -moz-transition, -o-transition and should be included as well.","evidence":"  -webkit-transition: opacity 200ms;\r","rule":{"id":"compatible-vendor-prefixes","name":"Require compatible vendor prefixes","desc":"Include all compatible vendor prefixes to reach a wider range of users.","browsers":"All"}}}

Note that the last two return checks are exactly the same, even though the CSS is different for all three sites - which says to me that the worker returned to two clients - hence the screw up.

I'd love for someone with experience to dive in an have a decent crack at getting the parent / worker set up correct - then we'll have a web service that doesn't blow up my machine when concurrent requests come in!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions