Folks- I just commited another revision of the plugin. Nothing huge in this update but some extra features. Acl lists are now configurable in the config file. So you will want to blow away and recreate your config file again. Thanks to Georg Friedrich for this. And I applied Gunter Ladwig''s patch for singleton worker classes. These are workers that only have one instance of the class in the whole drb server. Even if you call new_worker more then once with the same :class and it is a singleton worker, it will just return the one worker instance. Use like this: MiddleMan.new_worker(:class => :foo_worker, :args => "Bar", :job_key => :singleton_worker, :singleton => true) Cheers- -Ezra
Folks- OK there is a new release with some new features in it. The delete_worker method has been refactored to make sure it works with all kinds of workers(thanks Ben Johnson). I touched up the code in quite a few places. I also split the MiddleMan class and the BackgrounDRb::Rails class into their won files since they were getting bigger. Michael Siebert sent some nice patches that have been applied as well. Support for starting workers when the drb server starts up based on config file options and also cron style workers with repeating tasks. **NEW FEATURES** You can now have workers that autostart when the drb server is started, and you can also have cron like workers that run at intervals. To specify a worker to startup when the drb server does you can add something liek this to your backgroundrb.yml config file: autostart: job_key: class: foo_worker args: bar Change job_key to be the actual named key you want to use for this autostart worker. In you workers you can now have timed tasks that repeat themselves at intervals that you set. A simple example looks like this: class CronWorker <BackgrounDRb::Rails repeat_every 10.minutes first_run Time.now def do_work(args) @progress ||= 0 @progress += 1 end def progress @progress end end repeat_every takes anything that can be made into a Time object via Time.parse. Same thing with first_run. You can use all the nice rails active support time methods in these declarations like 2.hours and friends. Michael- I changed the method names for the cron style workers to something I like a little bit better. So make sure you change your workers that use the cron stuff to the new syntax. **FUTURE PLANS** I am working on a RindaRing server implementation in order to spread load between multiple drb servers at once. This allwos for multiple drb servers to easily find each other and share workers. Kind of like DNS for drb. This way if you have a really burly task you can run it in it''s own ruby process without having to use threading and compete with other threaded workers for cpu time. This will be a major overhaul of how things work so it might be released as a separate plugin, not sure yet though. Cheers- -Ezra
Rinda - funny I was just working on integrating this myself. grin. But since you''re going ahead I''ll head down another dev path I''d rather take at this time. You''re likely already further ahead, but I have some code to start a RingServer and and application TupleSpace(attached). It is inspired by the Borges server and Eric Hodel (segment7). Hope it can move you forward. I was intending to build a tuple space proxy into the MiddleMan so I could put/read/take from within rails (I prefer the loosely coupled processing offered by Rinda services). Perhaps after you''re finished I can add this capability - I''l likely look for your guidance. Also wanted to note that I tried AutoStart last night, and had real troubles with losing MySql connections (concurrent = false). I''ll try again with the latest. Thanx Ezra et al - this is a great project you''ve got going here. When you announced it a few months ago, I knew it was a keeper. cheers, Jodi On 1-Aug-06, at 2:59 PM, Ezra Zygmuntowicz wrote:> > Folks--------------- next part -------------- A non-text attachment was scrubbed... Name: launch_rinda.rb Type: text/x-ruby-script Size: 1371 bytes Desc: not available Url : http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060801/5a79dbdf/attachment.bin -------------- next part --------------> > > OK there is a new release with some new features in it. The > delete_worker method has been refactored to make sure it works with > all kinds of workers(thanks Ben Johnson). I touched up the code in > quite a few places. I also split the MiddleMan class and the > BackgrounDRb::Rails class into their won files since they were > getting bigger. > > Michael Siebert sent some nice patches that have been applied as > well. Support for starting workers when the drb server starts up > based on config file options and also cron style workers with > repeating tasks. > > **NEW FEATURES** > > You can now have workers that autostart when the drb server is > started, and you can also > have cron like workers that run at intervals. To specify a worker to > startup when the > drb server does you can add something liek this to your > backgroundrb.yml config file: > > autostart: > job_key: > class: foo_worker > args: bar > > Change job_key to be the actual named key you want to use for this > autostart worker. > In you workers you can now have timed tasks that repeat themselves at > intervals that you set. > A simple example looks like this: > > class CronWorker <BackgrounDRb::Rails > > repeat_every 10.minutes > first_run Time.now > > def do_work(args) > @progress ||= 0 > @progress += 1 > end > > def progress > @progress > end > end > > repeat_every takes anything that can be made into a Time object via > Time.parse. Same > thing with first_run. You can use all the nice rails active support > time methods in these > declarations like 2.hours and friends. > > > Michael- I changed the method names for the cron style workers to > something I like a little bit better. So make sure you change your > workers that use the cron stuff to the new syntax. > > > **FUTURE PLANS** > > I am working on a RindaRing server implementation in order to spread > load between multiple drb servers at once. This allwos for multiple > drb servers to easily find each other and share workers. Kind of like > DNS for drb. This way if you have a really burly task you can run it > in it''s own ruby process without having to use threading and compete > with other threaded workers for cpu time. This will be a major > overhaul of how things work so it might be released as a separate > plugin, not sure yet though. > > Cheers- > -Ezra > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
re: followup to AutoStart and mysql problems. The latest release looks good. Before, I could get a predictable crash quickly - Likely my code. Michael - thanx for the most-excellent cron and autostart contribs. Jodi ---------- Rinda - funny I was just working on integrating this myself. grin. But since you''re going ahead I''ll head down another dev path I''d rather take at this time. You''re likely already further ahead, but I have some code to start a RingServer and and application TupleSpace(attached). It is inspired by the Borges server and Eric Hodel (segment7). Hope it can move you forward. I was intending to build a tuple space proxy into the MiddleMan so I could put/read/take from within rails (I prefer the loosely coupled processing offered by Rinda services). Perhaps after you''re finished I can add this capability - I''l likely look for your guidance. Also wanted to note that I tried AutoStart last night, and had real troubles with losing MySql connections (concurrent = false). I''ll try again with the latest. Thanx Ezra et al - this is a great project you''ve got going here. When you announced it a few months ago, I knew it was a keeper. cheers, Jodi On 1-Aug-06, at 2:59 PM, Ezra Zygmuntowicz wrote:> > Folks--------------- next part -------------- A non-text attachment was scrubbed... Name: launch_rinda.rb Type: text/x-ruby-script Size: 1371 bytes Desc: not available Url : http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060801/3c0b7b8e/attachment.bin -------------- next part --------------> > > OK there is a new release with some new features in it. The > delete_worker method has been refactored to make sure it works with > all kinds of workers(thanks Ben Johnson). I touched up the code in > quite a few places. I also split the MiddleMan class and the > BackgrounDRb::Rails class into their won files since they were > getting bigger. > > Michael Siebert sent some nice patches that have been applied as > well. Support for starting workers when the drb server starts up > based on config file options and also cron style workers with > repeating tasks. > > **NEW FEATURES** > > You can now have workers that autostart when the drb server is > started, and you can also > have cron like workers that run at intervals. To specify a worker to > startup when the > drb server does you can add something liek this to your > backgroundrb.yml config file: > > autostart: > job_key: > class: foo_worker > args: bar > > Change job_key to be the actual named key you want to use for this > autostart worker. > In you workers you can now have timed tasks that repeat themselves at > intervals that you set. > A simple example looks like this: > > class CronWorker <BackgrounDRb::Rails > > repeat_every 10.minutes > first_run Time.now > > def do_work(args) > @progress ||= 0 > @progress += 1 > end > > def progress > @progress > end > end > > repeat_every takes anything that can be made into a Time object via > Time.parse. Same > thing with first_run. You can use all the nice rails active support > time methods in these > declarations like 2.hours and friends. > > > Michael- I changed the method names for the cron style workers to > something I like a little bit better. So make sure you change your > workers that use the cron stuff to the new syntax. > > > **FUTURE PLANS** > > I am working on a RindaRing server implementation in order to spread > load between multiple drb servers at once. This allwos for multiple > drb servers to easily find each other and share workers. Kind of like > DNS for drb. This way if you have a really burly task you can run it > in it''s own ruby process without having to use threading and compete > with other threaded workers for cpu time. This will be a major > overhaul of how things work so it might be released as a separate > plugin, not sure yet though. > > Cheers- > -Ezra > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
Hi Ezra, Thanks for the update and your hard work. One thing that might be of use (I could use it for my current project), is auto starting workers based on conditions. These conditions would most likely be from the database. Just a thought, because auto starting from yaml is fine, but you are limited in yaml when it comes to database interaction and conditions. Thank You, Ben Johnson E: bjohnson at contuitive.com On Aug 1, 2006, at 1:59 PM, Ezra Zygmuntowicz wrote:> > Folks- > > > OK there is a new release with some new features in it. The > delete_worker method has been refactored to make sure it works with > all kinds of workers(thanks Ben Johnson). I touched up the code in > quite a few places. I also split the MiddleMan class and the > BackgrounDRb::Rails class into their won files since they were > getting bigger. > > Michael Siebert sent some nice patches that have been applied as > well. Support for starting workers when the drb server starts up > based on config file options and also cron style workers with > repeating tasks. > > **NEW FEATURES** > > You can now have workers that autostart when the drb server is > started, and you can also > have cron like workers that run at intervals. To specify a worker to > startup when the > drb server does you can add something liek this to your > backgroundrb.yml config file: > > autostart: > job_key: > class: foo_worker > args: bar > > Change job_key to be the actual named key you want to use for this > autostart worker. > In you workers you can now have timed tasks that repeat themselves at > intervals that you set. > A simple example looks like this: > > class CronWorker <BackgrounDRb::Rails > > repeat_every 10.minutes > first_run Time.now > > def do_work(args) > @progress ||= 0 > @progress += 1 > end > > def progress > @progress > end > end > > repeat_every takes anything that can be made into a Time object via > Time.parse. Same > thing with first_run. You can use all the nice rails active support > time methods in these > declarations like 2.hours and friends. > > > Michael- I changed the method names for the cron style workers to > something I like a little bit better. So make sure you change your > workers that use the cron stuff to the new syntax. > > > **FUTURE PLANS** > > I am working on a RindaRing server implementation in order to spread > load between multiple drb servers at once. This allwos for multiple > drb servers to easily find each other and share workers. Kind of like > DNS for drb. This way if you have a really burly task you can run it > in it''s own ruby process without having to use threading and compete > with other threaded workers for cpu time. This will be a major > overhaul of how things work so it might be released as a separate > plugin, not sure yet though. > > Cheers- > -Ezra > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060801/75e35076/attachment-0001.html