A Place for my head

On Ruby, Rails, Concurrency and fiction

Posted in : backgroundrb, rails, ruby | 1 comment

Assuming nobody is reading this, I would quietly mention that, I released new version of BackgrounDRb plugin today.
Checkout full announcement here:

http://rubyforge.org/pipermail/backgroundrb-devel/2007-November/001043.html

Here is a sample worker:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class FooWorker < BackgrounDRb::MetaWorker
  set_worker_name :foo_worker
  attr_accessor :count
 
  def create
    puts "Starting Foo Worker"
    @count = 0
    add_periodic_timer(4) { increment_status}
  end
 
  def process_request p_data
    user_input = p_data[:data]
    result = self.send(user_input[:method],user_input[:data])
    send_response(p_data,result)
  end
 
  def increment_status
    puts "Registering status"
    register_status("stuff #{rand(10)}")
  end
 
  def foobar
    puts "Invoking foobar at #{Time.now}"
  end
 
  def add_values user_input
    p user_input
    return eval(user_input)
  end
end
 
=begin
  problems, with existing things.
=end

One Response to 'New release of BackgrounDRb available now'

Subscribe to comments with RSS or TrackBack to 'New release of BackgrounDRb available now'.

  1. Thanks for the work on BackgrounDRB, it is an extremely useful addition to any real-world Rails app! Although it may be a little hard to setup (docs on the forge should mention at least how to start the BDRB server ;) ), after that part is done it’s a treat.

    John

    12 Dec 07 at 12:34 pm

Leave a Reply