Announcing: Abraxas– A new Gearman client/worker/admin library

81 views
Skip to first unread message

Rebecca Turner

unread,
Jun 30, 2014, 2:22:29 PM6/30/14
to nod...@googlegroups.com
Abraxas is a end-to-end streaming Gearman client and worker library. (Server implementation coming soon.)

https://www.npmjs.org/package/abraxas

Standout features:

* Support for workers handling multiple jobs at the same time over a single connection. This is super useful if your jobs tend to be bound by external resources (eg databases).
* Built streaming end-to-end from the start, due to being built on gearman-packet.
* Most all APIs support natural callback, stream and promise style usage.
* Support for the gearman admin commands to query server status.
* Delayed background job execution built in, with recent versions of the C++ gearmand.

Things I learned on this project:

* Nothing in the protocol stops clients and workers from sharing the same connection. This was imposed by arbitrary library restrictions.
* In fact, the plain text admin protocol can be included cleanly on the same connection as the binary protocol.
* Nothing stops workers from handling multiple jobs at the same time, except, again, arbitrary library restrictions.
* The protocol documentation on gearman.org is out of date when compared to the C++ gearmand implementation– notably, SUBMIT_JOB_EPOCH has been implemented. I've begun updating the protocol documentation here:
  https://github.com/iarna/gearman-packet/blob/master/PROTOCOL.md

Because everything is a stream, you can do things like this:

    process.stdin.pipe(client.submitJob('toUpper')).pipe(process.stdout);

Or as a promise:

    client.submitJob('toUpper', 'test string').then(function (result) {
        console.log("Upper:", result);
    });

Or as a callback:

    client.submitJob('toUpper', 'test string', function(error, result) {
        if (error) console.error(error);
        console.log("Upper:", result);
    });

Or mix and match:

    process.stdin.pipe(client.submitJob('toUpper')).then(function(result) {
        console.log("Upper:", result);
    });


-- Rebecca


Ω Alisson

unread,
Jul 1, 2014, 12:18:50 PM7/1/14
to nod...@googlegroups.com
This is awesome!




--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/etPan.53b17213.327b23c6.587b%40Sierra-2.local.
For more options, visit https://groups.google.com/d/optout.

Aria Stewart

unread,
Jul 1, 2014, 7:50:55 PM7/1/14
to nod...@googlegroups.com
The mix and match interface really has me excited.
signature.asc

Joshua Holbrook

unread,
Jul 3, 2014, 5:11:41 AM7/3/14
to nod...@googlegroups.com
Looking forward to that server implementation! Being able to write
custom logic for job delegation would be sick.

--Josh
Reply all
Reply to author
Forward
0 new messages