Brian Aker brian at
Wed Apr 9 01:52:24 UTC 2008


So I have rolled out the first prototype for a C client version of the  
Client side work for Gearman:

I won't be rolling out releases for a little while, I will just be  
updating the mercurial repository.

Here is an example:
   gearman_return rc;
   gearman_st *param= (gearman_st *)object;
   gearman_result_st *result;
   gearman_job_st *job;
   char *value= "submit_job_test";
   size_t value_length= strlen("submit_job_test");

   result= gearman_result_create(param, NULL);
   job= gearman_job_create(param, NULL);


   gearman_job_set_function(job, "echo");
   gearman_job_set_value(job, value, value_length);

   rc= gearman_job_submit(job);

   assert(rc == GEARMAN_SUCCESS);

   rc= gearman_job_result(job, result);

   assert(rc == GEARMAN_SUCCESS);
   assert(result->action == GEARMAN_WORK_COMPLETE);
   assert(gearman_result_length(result) == value_length);
   assert(memcmp(gearman_result_value(result), value, value_length) ==  

In this case I had a worker called "echo" running. There should be  
enough of an API to build a fully functional client currently.

There is also support for clustering based on function built into the  
library (the library pulls heavily off of libmemcached).

Getting the worker protocol finished is next on the list. I welcome  
feedback! I've got a couple of users ready to start using it, so I am  
hoping that this will evolve quickly.


Brian "Krow" Aker, brian at
Seattle, Washington                     <-- Me                <-- Software
You can't grep a dead tree.

More information about the Gearman mailing list