Within a threaded worker, I would like to have multiple methods.  Will  
the following code work?

def method_1(args)

   thread_pool.defer(args) do |args|
     #work
   end

end

def method_2(args)

   thread_pool.defer(args) do |args|
    #work
   end

end

  . . . or, should I have one "meta"-method and pass which sub-method  
to perform via args?

def meta_method(args)

   thread_pool.defer(args) do |args|

    if args[:method] == "method_1"
      #do work
    end

    if args[:method] == "method_2"
      #do work
    end

   end

end




Thanks,
Ben
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel

Reply via email to