I just finished adding pluggable protocol support to the Gearman job server, this will enable even more methods of submitting jobs into Gearman. If all the various Gearman APIs, MySQL UDFs, and Drizzle UDFs are not enough, it’s now fairly easy to write a module that takes over the socket I/O and parsing hooks to map any protocol into the job server. As an example module, I added basic HTTP protocol support:
> gearmand -r http & [1] 29911 > ./examples/reverse_worker > /dev/null & [2] 29928 > nc localhost 8080 POST /reverse HTTP/1.1 Content-Length: 12 Hello World! HTTP/1.0 200 OK X-Gearman-Job-Handle: H:lap:1 Content-Length: 12 Server: Gearman/0.8 !dlroW olleH
I’ve added a few headers for setting things like background, priority, and unique key. For example, if you want to run the above job in the background:
POST /reverse HTTP/1.1 Content-Length: 12 X-Gearman-Background: true Hello World! HTTP/1.0 200 OK …[Read more]