libgearman

Brad Fitzpatrick brad at danga.com
Wed Apr 9 06:24:44 UTC 2008


Nice!  :-)

On Tue, Apr 8, 2008 at 6:52 PM, Brian Aker <brian at tangent.org> wrote:

> Hi!
>
> So I have rolled out the first prototype for a C client version of the
> Client side work for Gearman:
> http://hg.tangent.org/gearmandc/
>
> 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);
>
>  assert(result);
>  assert(job);
>
>
>  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) == 0);
>
> 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.
>
> Cheers,
>        -Brian
>
> --
> _______________________________________________________
> Brian "Krow" Aker, brian at tangent.org
> Seattle, Washington
> http://krow.net/                     <-- Me
> http://tangent.org/                <-- Software
> _______________________________________________________
> You can't grep a dead tree.
>
>
>
> _______________________________________________
> Gearman mailing list
> Gearman at lists.danga.com
> http://lists.danga.com/mailman/listinfo/gearman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/gearman/attachments/20080408/ce9341ad/attachment.html 


More information about the Gearman mailing list