Update to BackgrounDRb

Posted by ezmobius Tue, 01 Aug 2006 22:04:00 GMT

So I just pushed out a new release of this plugin that refactors some stuff I wasn’t happy with and adds a few very cool features. Thanks to some nice patches from Michael Siebert on the mailing list we now have support for workers to start up automatically when the drb server is started. And you can also have your workers repeat thier jobs at timed intervals like cron but simpler. Check out the README for more info on the autostart feature. Here is a little example of a worker that runs its task evey ten minutes starting from whenever the worker gets created with MiddleMan.new_worker:

class TimedWorker <BackgrounDRb::Rails  

  repeat_every 10.minutes
  first_run Time.now

  def do_work(args)
    # code in here gets called every 10 minutes 
  end

end

Tags , , , ,  | 3 comments

BackgrounDRb updated.

Posted by ezmobius Sun, 02 Jul 2006 01:44:00 GMT

Howdy Folks-

I'm happy to announce a new release of BackgrounDRb! I have added quite a few new features and included some nice patches from folks on the list.
$ script/plugin install svn://rubyforge.org//var/svn/backgroundrb

Click through for the details. Read more...

Tags , ,  | 18 comments

BackgrounDRb now with ActiveRecord Goodness.

Posted by ezmobius Mon, 12 Jun 2006 22:18:00 GMT

Quick note here to announce a new release of the BackgrounDRb plugin. THis release adds the ability to easily work with your ActiveRecord models from your worker classes. I also added a config file that you can use to change the port and host as well as tell it whether or not to connect to the database and what environment to use when doing so.

Also worker classes are even easier to create now. You no longer have to deal with Threads yourself and the @logger object is automatically available to you. So now a worker class inherit from BackgrounDRb::Rails and looks like this:

class MyWorker < BackgrounDRb::Rails

  def do_work(args)
    # put your code in here to run your tasks.
    # this method is called when you create a 
    # new worker. No more dealing with Threads
    # yourself!
  end

end

Home page: http://backgroundrb.rubyforge.org
svn repo: svn://rubyforge.org//var/svn/backgroundrb Mailing list: http://rubyforge.org/mailman/listinfo/backgroundrb-devel

Tags , ,  | 6 comments

BackgrounDRb gets a mailing list

Posted by ezmobius Tue, 30 May 2006 16:46:00 GMT

BackgrounDRb has spawned quite a bit of interest from people who need something like this. So I have set up an official rubyforge project for it. Everyone please get the latest version from the new url the old one is still there for now but will be gone soon.

There is also a mailing list started for discussion of using or extending the plugin for peoples needs. I plan on doing quite a bit of work on this and I have many features planned for the next version. So please do sign up for the mailing list to discuss how you are using this plugin. You can help shape the development of this micro-framework as it gets more mature.

You can find out more information or subscribe to the mailing list here:

Mailing List: http://rubyforge.org/mailman/listinfo/backgroundrb-devel
rubyforge project: http://rubyforge.org/projects/backgroundrb/
README: http://backgroundrb.rubyforge.org

Install with:

$ script/plugin install svn://rubyforge.org//var/svn/backgroundrb

Tags , , , ,  | 3 comments

BackgrounDRb new release

Posted by ezmobius Thu, 25 May 2006 18:14:00 GMT

BackgrounDRb has got a face lift. Thanks to Saimon Moore it is now a full fledged rails plugin. Complete with rake tasks for installing the start stop scripts, a generator for creating new worker classes, and rake tasks to start and stop the server.

Thanks Saimon!

[EDIT] SVN repo has moved to rubyforge. Please use new url: svn://rubyforge.org//var/svn/backgroundrb

Also see README at rubyforge:
http://backgroundrb.rubyforge.org/
[EDIT] See examples/css.js.progressbar.txt for pure css/js progress bar examples. Thanks to Werner Bohl for making the css/js.

[EDIT] I just added logger support for your worker classes. You can now use BACKGROUNDRB_LOGGER to log messages from your worker classes to RAILS_ROOT/log/backgroundrb.log.

Read more...

Tags , ,  | 17 comments

BackgrounDRb initial release

Posted by ezmobius Mon, 15 May 2006 17:57:00 GMT

I’m happy to announce the first alpha release of BackgrounDRb for rails. I plan to extend this framework to meet the needs that arise for long running background tasks. It is currently in a very good working state but I want to release it and get feedback from people as to how they will use this setup.

So please use and abuse this and let me know how it works or doesn’t work for you.

You can get BackgrounDRb from subversion here:

svn://rubyforge.org//var/svn/backgroundrb



Click Thru for the README on what this is all about

[EDIT] Added ActiveRecord caching with a simple interface. Like so:

def fill_cache
  @posts = Post.find(:all, :include => :comments)
  MiddleMan.cache_as(:post_cache, @posts)
end  

def retrieve_cache
  @posts = MiddleMan.cache_get(:post_cache)
end
Read more...

Tags , , , ,  | 26 comments

Preview of DRbWorker plugin with ajax progress bars.

Posted by ezmobius Thu, 04 May 2006 03:31:00 GMT

So here is a little screencast preview of my next plugin. I got the proof of concept working today. You will be able to register your own classes that do long running background tasks with the drb server. And then start your classes from an ajax call. Then you periodically_call_remote to grab the progress of your worker which is access via a key you store in the session. This is the concpet:



Have a look at the screencast of the proof of concept in action.

View ScreenCast

I am planning to finish this up and have it ready to be released as a plugin soon ;-)

Tags ,  | 8 comments