On Jul 24, 2006, at 8:17 AM, Ross M Karchner wrote:
> Hello,
>
> Thank you so very much for Backgroundrb. Good Stuff.
>
> A general question:
>
> Do:
> - calling ''teminate'' within a worker
> - calling delete_worker through MiddleMan
> - letting the :ttl expire
> - calling MiddleMan.gc! (with an appropriate timestamp)
>
> All accomplish the same thing?
>
> And here''s a bonus feature request: It''d be cool if you
could specify
> how many instances of a particular worker class can be active at the
> same time-- anything over that gets queued.
>
> I''m open to any suggestions for implementing that on my own, but
it
> would make a nifty feature for the plugin.
>
> -Ross
Ross-
Yeah those all do mostly the same thing with a few differences. the
terminate method is what you should have your worker call when it is
done processing its job. THis will still leave the worker in the jobs
hash but it wont be running anymore. THen you can either use :tt;,
delete_worker or gc! top delete the worker. NExt release will remove
the worker from the jobs hash as well as stop its thread when you
call terminate.
The next release of the plugin will address a bunch of these issues.
I will be cleaning up the code base and refactoring to use rinda ring
where possible. This will mean some API changes but not much. Your
worker classes will be essentially the same. But this will allow for
you to have workers run in there own drb server. So you can have
multiple drb servers but they all have dns of sorts through rinda
ring finger.
The limit on the number of allowed workers is probably a good idea.
BUt I am pretty busy these days so a patch for that would probably be
applied but I might not get around to doing it myself for a while yet.
Cheers-
-Ezra