similar to: Threads vs. Processes and Rails

Displaying 20 results from an estimated 9000 matches similar to: "Threads vs. Processes and Rails"

2006 May 15
10
BackgrounDRb background task runner and Application Wide Context Store
Friends- I''m happy to annouce the first alpa release of BackgrounDRb. This is a small framework 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.
2006 Jul 05
5
''m having trouble with BackgrounDrb
Hi. I thought that BackgrounDrb was the perfect solution for my long running report production tasks. But I can''t seem to get anything useful back out of it. I set up a simple test worker that just does class TestWorker < BackgrounDRb::Rails attr_reader :pupil def do_work(args) @progress=0 @pupil=Pupil.find(3) sleep rand*10 @progress=100 end when I try to
2006 Jul 19
1
A couple of problems
Hi Ezra, Thanks for the great work on BackgrounDRb. I have come across a couple of problems. 1. I wanted to define a simple class in the worker file to wrap up and pass back some data to my controller. It seems that if I create the class either inside or outside of my worker class (in the same file) it gets wrapper by a DRb::DRbUknown object and therefore cannot be accessed from my controller.
2006 Aug 16
7
Forward of moderated message
OK I know whats happening. Your while loop completes and calls kill on the worker before your task_progress controller method ever gets called> So the worker is deleted and when you try to access it from rails you get an error because there is no longer a worker at that job key. The kill method is meant to be used within a worker that you fire and forget. If you want to get the
2007 Dec 21
7
Using my models
I''m working on upgrading my app to the latest version of backgroundrb. Everything went find until I tried to execute my tasks. Here is my simple worker for testing: class MscWorker < BackgrounDRb::MetaWorker set_worker_name :msc_worker def create(args = nil) # this method is called, when worker is loaded for the first time end # Send a message to everyone def
2007 Sep 24
3
Trouble using backgroundrb
Hi all, I''m a newbie to backgroundrb and am having trouble integrating it into my rails-app. I''m using namespaces to differentiate between the parts of my app. When I want to create a new worker, it seems that it cannot find the worker object. Here''s my code: -------------------- controller app/passwd/index -------------------- class Passwd::IndexController <
2006 Dec 15
1
:job_key acting weird?
Hi all I''m experiencing something strange with a :job_key, it took me a very long time to find out a worker wasn''t doing it''s job because of the name of my job_key. The first one I tried was :make_kohier, and with that name (and lot''s of other ones) I can''t get the worker to work. I do get my key in return, but the job doesn''t start
2006 Sep 08
1
Access worker outside of Rails?
Hi all, Wondering if it''s possible to access a worker from outside of Rails -- I''ve tried simply including: require RAILS_ROOT + ''/vendor/plugins/backgroundrb/backgroundrb.rb'' BackgrounDRb.MiddleMan.get_worker(key) but, I get an error that the ''get_worker'' method is undefined. Any ideas? Thanks a lot, W -------------- next part
2006 Oct 12
6
BackgrounDRb newbie stuck at first base. Fresh pair of eyes needed
Can''t believe I can''t see the problem here, but after a few hours bashing my head on a brick wall, going to risk looking stupid by seeing if anyone can point out my idiocy (that''s the worst thing about coding on your own). Trying to get BackgrounDRb to take over the scraping task which is currently being done in a Rails controller. That''s not the problem at
2006 Jul 13
4
Update
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
2006 Jul 03
6
Req: Workers as singletons
Hi, it would be nice to be able to specify workers as singletons. By this I mean that every call to the new_worker method returns the same instance of said worker. This can be done transparently either by adding a new argument to new_worker (something like :singleton => true) or adding a new method, like I did in my installation of BackgrounDrb: def get_worker_by_class(klass)
2006 Sep 05
2
question about passing array of AR objects to worker
got a wierd problem maybe someone can help with. whenever i try to pass an array or AR objects to my worker, i end up with a DRb object in the worker...here''s an example class SearchWorker < BackgrounDRb::Rails attr_reader :resources def do_work(resources) logger.info resources.inspect end end class SearchController < ApplicationController def start_search
2006 Aug 07
4
Memory leak?
I am using BackgrounDRb to resize images after they are accepted into our system. However, it has become clear that this creates a memory leak. I''m not sure exactly where the leak exists, but I don''t think it''s in my own code as it is presently being used in production and has resized thousands of images without a leak occurring, thanks to calling GC.start
2006 Jul 19
1
Testing worker classes
Hi, Does it make sense to test a worker class by calling Middleman.new_worker? Or should I just be testing the functionality in the do_work method, with, say, a mock object. This seems like a really ugly DRY violation: you''d need to keep the code in the mock and the real worker in sync. That''s the philosophical half of my question. In fact, until someone tells me why I
2006 Oct 27
8
Error after moving to production server
so i have an after_create method on my track model that kicks off a background process that converts an mp3 to a swf. this is working fine locally on my machine, but upon moving it to my production server, i am getting the following error. I''ve only been using backgroundRB for like 48 hours, so i''m not really sure what this means or where to go. any ideas?
2006 Dec 04
4
Question about acls
Hi, I''m not much of a developer but I''ve been using backgroundrb for a while now and with the release of 0.2.1 it looks like I can finally upgrade from the old version (0.2.0 had some weird issues when jobs just wouldn''t run, seems to have cleared up now - Thanks!). Anyhow, while I''m doing this, I would like to tackle this problem. Most tasks I run in
2006 Oct 17
6
Session access interfers with other model access
Sorry to be such a bother but I''m not getting this. I have two models: Emrec and Session (I''m using AR for session mgmt.) In my worker I can access the Emrec model and delete a record, AS LONG AS I don''t try to access the Session model. With the Session model access commented out as below, the Emrec record gets deleted. If I uncomment those lines, the Emrec
2007 Jan 22
7
Yet Another Problem with BackgroundRB
Hi! My cron-based worker is being indeed invoked by backgroundRB at correct times. But... After several runs it can no longer find DB columns! The same query, which was running OK an hour ago starts to throw MySQL error about unkown column in where clause. If I restart backgroundrb it works for some time but stops working after several invocations. Has anyone epxerienced the similar beahviour?
2006 Nov 29
6
Noob needs help installing backgroundrb on Windows XP
Hey Guys, In the readme for Backgroundrb it says that windows support has been depcreated for this version, but then it goes on to mention how to use it in Windows. So I''m not sure if it should be running on windows or not, so I''ll ask anyway. Also, I''m new to ruby and I''m also new to server administration, so I apologize if my questions are pretty
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