similar to: Thread_pool bug?

Displaying 20 results from an estimated 300 matches similar to: "Thread_pool bug?"

2008 Jan 03
1
Memory leak and long process problem
I use backgroundrb for many long tasks in my system, but I''m having issues with one in particular. Two large tasks for me are importing people and updating companies. def import_contacts(args = nil) thread_pool.defer(args) do |job_id| begin job = ImportJob.find(job_id) job.process_job rescue => err logger.error "MscWorker#import_contacts
2008 Jan 03
0
Strange problem
I use backgroundrb for many long tasks in my system, but I''m having issues with one in particular. Two large tasks for me are importing people and updating companies. def import_contacts(args = nil) thread_pool.defer(args) do |job_id| begin job = ImportJob.find(job_id) job.process_job rescue => err logger.error "MscWorker#import_contacts
2008 Feb 01
3
Job Queue
After some initial stumblings, I think I''ve got the hang of backgroundrb. It''s great! I''d been thinking for many many months how cool something like this would be! I''m trying to make a "job queue". That is, a pool of worker threads monitor a queue. When a job appears, one of the workers grabs it and executes the task. When complete, the worker
2007 Aug 22
3
tackle memory insufficiency for large dataset using save() & load()??
Hello List, i have been agonizing over this for days, any reply would be greatly appreciated! Situation:___________________________________ My original dataset is a .csv dataset (w/ 2M records) with 4 variables: job_id (Primary key, won't be used for analysis, just used for join tables), sector_id (categorical variable, for 19 industry sectors), sqft (con't variable for square
2007 Apr 26
1
mapping column names in legacy schemata
I have a legacy MySQL database with a weird naming convention - all table and column names have a prefix ''_'' , which is annoying, and some of the column names are misnomers. I would like to apply a pre-defined mapping between MySQL column names and method names to be used in the Ruby class, without having the original column names being visible anymore. how can I pre-define a
2006 Jul 02
18
JOIN conditions
Hi, how can I get Rails to generate SQL queries with conditions in the JOIN clause? What I would want is: SELECT * FROM people p LEFT OUTER JOIN jobs j (p.job_id = j.id AND j.salary > 9999999) I tried People.find(:all, :include => ''jobs'', :conditions => ''jobs.salary > 9999999'') but that generates SELECT * FROM people p LEFT OUTER
2007 Dec 19
6
thread_pooling sleeping
I''m trying to run a single worker that could perform a periodic task for a given user. >From a controller, I imagine something like: def start_job MiddleMan.ask_work(:worker => :foo_worker, :worker_method => :perform_task, :data => { :user_id = current_user.id }) end def check_job @status = MiddleMan.ask_status(:worker => :foo_worker)[current_user.id] end
2006 Aug 24
3
A new QueueWorker class
Hello all, I''ve come up w/ a worker class that manages queued jobs using a fixed number of child workers. Well, that''s not quite true -- a new worker is spawned for each job, but you set the total number that may exist at once. There are three components: 1) queue_worker.rb: The singleton worker that manages the child workers. You probably want to auto start this. Make sure you
2008 May 09
1
register_status for excess thread_pool?
Hi, Newbie here. I''ve got a worker (for generating PDF reports) that uses the "thread_pool" to allow processing multiple reports simultaneously and queue up any requests that exceed the thread pool (pool_size = 10 currently). def process_pdf(user) thread_pool.defer(user) do |user| makepdf(user) end end My question is: I use a mutex to handle
2006 Sep 23
1
Better rails way to join tables?
Hi, I''ve figured out how to join tables using :joins, but is there a more elegant way to do this using built-in rails methods? Here is the code: Hiringstep_Job.find( :all, :joins => ", hiringsteps", :conditions => ["hiringstep_jobs.hiringstep_id = hiringsteps.id AND job_id = ?", 1]) Thanks, David -- Posted via http://www.ruby-forum.com/.
2005 Nov 20
1
mySQL 5.0 upgrade - incompatible DateTime format?
I''ve upgraded to mySQL 5.0, and it''s gone pretty smoothly except that on DateTime.now doesn''t seem to return a value that mySQL likes any more, as seen in the following exception: Incorrect datetime value: ''2005-11-20T15:33:12-0800'' for column ''logged_at'' at row 1: UPDATE notes SET `due_on` = ''2005-11-20'',
2008 Jan 22
2
Threadpool and queuing of tasks
I recently switched over to v1.0, and things are rolling along pretty well. However, one thing that has always been a little confusing to me is knowing when to use thread_pool. Since most of my bgrb workers are called from my web app to process rather than being scheduled, I''m using the thread_pool for every call. Unfortunately, that means that I have to split up workers by how many
2005 Dec 12
2
count sql failing with unknown table....
Hey Rails People, I''m doing my first Rails app and I''m having a newbie problem with the count method.... Mysql::Error: #42S02Unknown table ''jobs_sectors'' in where clause: SELECT COUNT(*) FROM jobs WHERE (jobs_sectors.sector_id = 1 ) Extracted source (around line #4): 1: <div class="sectors"> 2: <ul> 3: <% for sector in @sectors
2005 Dec 05
1
Lack of 'LEFT JOIN' in Oracle 8, any patch for theta style (+)
Dears, Oracle 8 don''t support ANSI syntax with : SELECT e.emp_id, e.fname, e.lname, j.jobdesc FROM employe e LEFT JOIN jobs j ON e.job_id = j.job_id but only SELECT e.emp_id, e.fname, e.lname, j.jobdesc FROM employe e, jobs j WHERE j.job_id (+) = e.job_id JOIN syntax came with 9i. Anyone patched Rails
2006 Jul 06
4
Oracle HR on Rails
Interesting read...apologies if it has been posted already. http://www.oracle.com/technology/pub/articles/saternos-rails.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060706/619e650a/attachment.html
2008 Jan 13
3
right usage of bdrb
Hi, i''m going to implement a syndication-service, which will get lists in xml with some meta-data an enclosed video files, which will get encoded at the end. The syndication run will be startet every five minutes of a full hour. So i thought to build 4 Worker. One for checking which feeds to syndicate (syndication_worker) at a specific time, one for processing the list
2008 Mar 18
1
Polling is REALLY slow
I''m having some trouble with using brb for polling for work. Basically, what I want to do is update the state of a record and have brb notice and start a process. I do not want to call ask_work for each process because there may be several places where the object''s state is changed, and I only want to process once. Plus, I can schedule things better this way. My first thought
2007 Apr 26
0
ActiveRecord: mapping column names when using legacy schemata
I have an ActiveRecord question... I have a legacy MySQL database with a weird naming convention - all table and column names have a prefix ''_'' , which is annoying, and some of the column names are plain misnomers. I would like to apply a pre-defined mapping between MySQL column names and method names to be used in the Ruby class, without having the underlying column names
2006 Jan 30
5
Action Mailer woes
Hi gang, Im having my first stab at ActionMailer and not having any luck. Perhaps someone could help me out. I generated a a mailer called ItemMailer - its purpose is to take some information that I''ve already gathered in a ToDo list form and to mail it out to the person who is nominated for the task In environment.rb I have; ActionMailer::Base.server_settings = { :address =>
2008 Dec 22
7
Help creating and using database
I have this problem. I have a Job table in my db, and each job has many steps (table Step). Is not possible to know how many steps a job has until it is created. So when I create a new job I have a problem: I can not have a step_id in my Job table, because it can be one step or more. What can I do? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~