search for: middleman

Displaying 20 results from an estimated 270 matches for "middleman".

2006 Aug 07
2
Autostarting and job keys...
I''ve now got 5 processes auto started. But I when I query the MiddleMan for their keys (in script/console), it doesn''t find them. Looking at the start script, it looks like it might be creating a new MiddleMan object for each autostart BackgrounDRb::MiddleMan.new.new_worker(:class => entry[''class''], Even changing it to Backgr...
2007 Feb 01
3
with-arguments block is executed regardless of method?
I have a test case where I''m stubbing one method (''jobs''), and mocking another (''new_worker'') MiddleMan.stubs(:jobs) MiddleMan.expects(:new_worker).with{|args| args[:class] ==:download_worker} MiddleMan.jobs() The above code results in an error ("The error occurred while evaluating nil.[]") - calling ''jobs'' results in the with-arguments block for new_worker getting...
2006 Aug 01
4
Creating workers from workers?
Since MiddleMan is an uninitialized constant in a worker how do you create new workers inside a worker? Thank You, Ben Johnson E: bjohnson at contuitive.com O: 800-341-6826 M: 817-229-4258 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroun...
2007 Jan 15
6
Instantiating middleman and worker from inside a model?
In short: how (if possible) would i go about arranging it so that i can instantiate a middleman and set a worker going from within a method in one of my models? or is this a weird thing to be wanting to do? ( My specific situation: I have an ''Image'' model in my application. An actual image file associated with the model is being stored on amazons s3 system. I'...
2007 Jan 22
1
MiddleMan behavior
i found some questions and answers on mailing lists but there is still a problem - when i want to create new worker from within a worker - ::BackgrounDRb::MiddleMan.new_worker(:class => :second_worker, :args => {:id=>2, :text=>"slave"}) works but when i want to get reference to that object: ::BackgrounDRb::MiddleMan.worker(@second) yields: NoMethodError: undefined method `worker'' for BackgrounDRb::MiddleMan:Class f...
2006 Jul 18
7
backgroundrb and autotest
Hi, First, thanks for the plugin. Sorry if this is not strictly a backgroundrb issue but I thought others on this list might have come across this problem. I''m trying to run the test that comes via the worker generator. The test works fine when running ''rake test_functional'', but when the tests are run by autotest I get "uninitialized constant BackgrounDRb"
2006 Oct 16
0
MiddleMan singleton issue in start script
...his thread in the August backgroundrb-devel archives. >This means that in order to reference the new_worker method *in the >instance that is running in the drb server* you can''t do that >directly. In order to spawn other workers from within a worker I >would have to change the MiddleMan class to be a singleton. This way >you could grab the one instance of it and call new_worker on that and >it would work as expected. But the way it is currently setup, you >don''t have a reference to the Main MiddleMan instance from within >your workers. > I don''...
2007 Oct 25
3
Mocking Workers in Backgroundrb
Hi Has anyone mocked a call like the following for backgroundrb? MiddleMan.new_worker(:class => :admin_email_worker, :args => params [:email]) I cannot seem to find the correct manner to do it. Would have liked to be able to do MiddleMan.should_receive (:new_worker).with(:class => :admin_email_worker, :args => {"body" => "my message...
2008 Jan 25
4
hi, can someone explain to me backgroundrb and mongrel?
...questions.... rails can handle 1 request at a time and can buffer to a certain extent? when mongrel instances are created, a copy of the rails app is loaded into each mongrel instance''s memory space? these mongrel instances can read and write to the mysql database simultaneously? the middleman of backgroundrb, is he on his own thread outside the rails app or is he using a mongrel instance? how about the middleman''s workers, are they on their own thread outside the rails app or would they be working with a mongrels instance? thanks for any help! my main goal is to create a sca...
2006 May 15
10
BackgrounDRb background task runner and Application Wide Context Store
...work for managing long running background tasks that allows for ajax progress bars and more. It also serves as an Application wide cache and context store for when you need something like sessions but shared between users and multiple backend processes like fcgi''s or mongrels. This MiddleMan runs in a drb(distributed ruby) process that is separate from the rails process. This allows for all backends to have one place to store data or launch jobs from. You can see the proof of concept screencasts here: http://brainspl.at/drb_progress.mov http://brainspl.at/drb_ajax_tail.mov And...
2006 Dec 27
2
calling a MiddleMan from inside a MiddleMan
Is it possible to call a worker from inside a worker? Right now, if I try, I get a recycled object error.
2009 Feb 16
1
MiddleMan.new_worker => nil
I''ve been checking out all the async gems and plugins for Rails, and decided to give BackgroundRb a shot. Unfortunately, I''ve not even been able to get past the initial stages. Whenever I call MiddleMan.new_worker, it invariably returns nil. The log file remains empty. I''ve only tried this from the console so far. If I can''t even do this successfully, I''m in no mood to try to start to write code, I''ve followed the example instructions to the letter, and confir...
2007 Mar 02
1
example standalone error.
Hello, Trying to get the example to work in standalone mode. I have the following in a file and am not certain why I get this undefined method error: error: ~/ruby sample_app.rb my sample app :) sample_app.rb:9: undefined method `new_worker'' for BackgrounDRb::MiddleMan:Class (NoMethodError) ### code follows ### # sample_app ... try to get stand-alone happiness. #require ''release-0.2.1/lib/backgroundrb'' #MiddleManDRbObject.init(:uri =>''drbunix:///tmp/backgroundrbunix_localhost_2000'') require ''backgroundrb/middleman...
2006 Jul 01
9
BackgrounDRb New release.
.../plugin install svn://rubyforge.org//var/svn/backgroundrb All of the code now stays within the plugin and the start and stop scripts are now just stubs. This makes it easier to tweak or figure out how it works. The backgroundrb.rb file in the root of the plugin dir is the drb server part of MiddleMan and the pluginroot/lib/ backgroundrb.rb file is the rails client side MiddleMan. One of the new things is much better threading job control. This is mostly invisible to you as a user of the plugin but it makes the whole system a lot more sturdy. It gives your worker objects the chance to c...
2007 Apr 26
2
looking for a worker that''s gone
...he job key when a worker is fired off and then check back in periodically to see how its doing. The workers delete themselves when they''re done. I would expect when I try to get a worker that has been deleted, I would get nil or a proper exception, but instead I get: >> MiddleMan.worker(''foobar'') NoMethodError: undefined method `object'' for nil:NilClass from (drbunix:///tmp/backgroundrbunix_localhost_2000) /Users/ brandon/projects/backgroundrb/vendor/plugins/backgroundrb/server/lib/ backgroundrb/middleman.rb:396:in `worker'' I&...
2006 Dec 07
2
backgrounDRb problems with results and MiddleMan
...them. My second issue is that I''m trying to create an after_filter to a controller that looks for any "keys" saved to the session and then load the worker class to query status (assuming that "response" actually worked..). When I try to re-substantiate the worker using MiddleMan.worker(worker_key) I get an error reporting that worker is not a method of MiddleMan. NoMethodError (undefined method `worker'' for #<BackgrounDRb::MiddleMan:0x146377c>): /app/controllers/workbench_controller.rb:31:in `get_rid_of_workers'' All the rdoc documentation I&...
2006 May 25
1
New BackgrounDRb release
...way to install and control the drb server is caching. You can now use BackgrounDRb as a full fledged in memory cache for any type of object that can be Marshal''ed. Here''s a peek: To cache an object you can do it two ways. @posts = Post.find(:all, :include => :comments) MiddleMan.cache_as(:post_cache, @posts) OR MiddleMan.cache_as :post_cache do Post.find(:all, :include => :comments) end And to retrieve the cache you can either just grab it and if there is nothing there it will return nil. Or you can supply a block that the contents of will get placed in the cach...
2008 Jan 17
3
periodic scheduling
...the work (however long that may take), then pause for a "sleep time" and start over. With the old version of backgroundrb, I was never able to get any of the scheduling options to quite do what I wanted to do, so I just ran without scheduling. I manually started all my workers by calling MiddleMan.new_worker in a script, passing in the "sleep time", and then implemented each worker something like this: def do_work(args) @args = args @sleep_time = @args[:sleep_time] logger.info "CampaignStarter #{jobkey} started" while(true) # do the actual work in...
2007 Jan 11
4
Load balancing
Hi, Can somebody point me in the right direction about what approach would be best to load-balance between two or more physical servers running backgroundrb while using BackgrounDRb::Worker::RailsBase with mongrel? Thanks, Robert Bjarnason
2007 Mar 07
10
MiddleMan.worker blocks?
Hello - I am observing that calls to MiddleMan.worker return only after the worker has completed its work. This puzzles me, and I presume that I am doing something wrong. Can anyone make suggestions? Snippets from my code are: class ReportController < SecurityController ... def create_xml_report(report,start_time) constrai...