Hello. I read in an old announcement by Ezra, relating to the older version of BackgrounDRb, about workers being able to clean up after themselves and a TTL feature. I''m not sure if these things are present in the newer version. I''ve tried overriding the delete method in my worker but when I call delete_worker, the method doesn''t appear to be called. Is there a right way to do this? If not, could a callback be added? The :ttl option doesn''t appear to be there anymore. With scheduling, does :end actually delete the worker or merely stop making calls to it? If it doesn''t delete, I could achieve the same effect by setting up a scheduler that sends different args between the first and second calls and do_work could subsequently delete the worker on the second call. This seems rather awkward though. Is there a better way? Cheers, James
On Sat, 19 May 2007 13:14:19 +0100 James Le Cuirot <chewi at aura-online.co.uk> wrote:> I''ve tried overriding the delete method in my worker but when I call > delete_worker, the method doesn''t appear to be called. Is there a > right way to do this? If not, could a callback be added?I''ve now tried various other things but the only way I''ve been able to do it is by using at_exit, as mentioned in the Slave README. Simply calling at_exit from within the worker class doesn''t seem to work. You have to call it when creating the slave. Here''s a small patch against 0.2.1. I tried the same thing against trunk and it worked. Is it any good? I still would also appreciate info on the TTL issue. Cheers, James -------------- next part -------------- A non-text attachment was scrubbed... Name: backgroundrb-at-exit.patch Type: text/x-patch Size: 1050 bytes Desc: not available Url : http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070521/c7b69d9f/attachment.bin