Displaying 20 results from an estimated 1000 matches similar to: "Best way to start a worker"
2006 Nov 07
2
start a worker when bdrb starts
I am sure..again I am missing something, but I am trying to start a
worker, when backgroundrb starts and it doesn''t seem to work.
Here is my config/backgroundrb_schedules.yml file:
feed_worker:
class: feed_worker
job_key: feed_worker_key
worker_method: do_work
trigger_args:
repeat_interval: 20.minutes
I even tried this from Rails controller:
# def start_feed_worker
#
2006 Nov 20
2
schedule support on latest svn, a question
I''m running the latest backgroundrb mainly for scheduled tasks support.
As per the documentation I created the backgroundrb_schedules.yml with
the following:
simple_label:
:class: :document_sorter_worker
:worker_method: :do_work
:job: :bleh
:trigger_args:
:start: <%= Time.now + 5.seconds %>
:end: <%= Time.now + 10.minutes
:repeat_interval: 1.minute
Under
2007 Feb 14
1
Scheduling in backgroundrb not working
Hi ,
How do i schedule a job that can send emails at intervals of time
using backgroundrb and rails
For testing When i hit the controller i''m able send the emails.
but that is not i intend to do .....
I want to use backgroundrb and rails in which i''ll schedule a job
for every 5 minutes/ 1 minute or so..... to send an email
But when i write
2007 Mar 13
5
worker starting twice
Hi gang,
Thanks to other help I''ve gotten on this list, I''ve got backgroundrb
up and running using postgres alongside my rails app. I''ve designed
the system to have several eternally-running workers that periodically
poll the database to see if there''s any work for them to do, and set
things up in the config file to make them restart quickly if any of
them
2007 Feb 18
2
backgroundrb launches concurrent instances of same job
Hi there,
Backgroundrb is working pretty well for me but I have a job that launches
two of the same job, apparently a minute(?) apart from each other. Should
this be happening if I have repeat interval enabled with a job_key? It
seems like it should wait until the job is finished before launching a new
instance.
--Backgroundrb_schedules.yml--
city_updater:
:class: :city_updater_worker
2007 Mar 05
2
Scheduled workers only run once unless you call self.delete inside the worker
I had a worker scheduled to run every minute with
backgroundrb_schedules.yml:
ebay_runner:
:class: :ebay_auction_worker
:job_key: :ebay_auction_runner
:trigger_type: :cron_trigger
:trigger_args: 0 * * * * * *
This worker posts an auction to eBay from a queue of auctions every minute.
I was having a problem where the worker would run ok the first time, but
never any subsequent minutes
2007 May 22
4
Recommendations for eternally-running backgroundrb workers?
I''ve got some workers that I want to have running all the time. Right
now I''m just launching them manually, by requesting a special page in
my rails app that includes lines like:
MiddleMan.new_worker(:class=> :receiver, :job_key=>:r,
:args=>{:sleep_time=>10})
This strikes me as a really weak way to fire up my workers. I
basically want to automate things so
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 <
2007 Jan 15
2
Backgroundrb keeps spawning processes
Hi!
I''ve just a created a really simple rails scheduled worker for
backgroundrb to start playing with :
class SessionCleanerWorker < BackgrounDRb::Worker::RailsBase
def do_work(args)
logger.info "SessionCleaner> started"
CGI::Session::ActiveRecordStore::Session.destroy_all( [''updated_at
<?'', 120.minutes.ago] )
2006 Dec 08
3
Thread Pool Size?
Hi All,
It might be lack of sleep, but I am struggling to accurately limit our pool
size. It seems like I can specify it on the server with the -s command
line option and also on the client via the YAML pool_size. Is that right?
Which one wins?
Our problem is that we are getting about 40 threads on each backgroundrb box
and it''s flooring our db and each bgrb box.
We want around 8.
2007 Feb 22
1
failed to find slave socket - (RuntimeError)
Hi everyone,
I''ve a class that try to spawn two workers, every 5 seconds.
The code is something like:
while true do
MiddleMan.new_worker(:class => :researches_worker,:job_key
=> :researches)
MiddleMan.new_worker(:class => :products_worker,:job_key => :products)
sleep(5)
end
I''m using ":job_key", so if a worker hasn''t already ended its work
2007 Jun 25
3
one more "uninitialized constant" problem
Hi everyone,
I''m new to backgroundrb, and I''m trying to get started with a simple example, yet with no success.
This is the code that I have in RAILS_ROOT/lib/workers/testing_worker.rb
class TestingWorker < BackgrounDRb::Worker::RailsBase
def do_work(args)
# This method is called in it''s own new thread when you
# call new worker. args is set
2006 Dec 08
2
trouble using ActiveRecord classes
I''ve been trying unsuccessfully for the better part of today to write a
worker that can use by ActiveRecord model classes.
The bizarre thing is that worker just stops at the point accessing the
database connection. An exception isn''t raising, it just dies.
My worker class is below, I''ve interspersed log messages throughout to try
to determine where it is dying.
=====
2006 Dec 11
1
scheduled only called once
when working with the scheduler i found that using
:trigger_args: 0 * * * * * *
in config/backgroundrb_schedules.yml the worker gets only called once.
:trigger_args: "0 * * * * * *" works as expected.
Maybe this should be changed in the README ?
regards tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Nov 05
5
backgroundrb preview
Hi Ezra/skaar,
Wow man, the exercise was worth it. The connection closed problem with
socket as i mentioned in my earlier mails...completely disappeared,
and now i can connect only once to the socket and keep reading..till
end of its days.
Literally impossible with older release of backgroundrb.
This could also potentially solve the issues people were having with
ActiveRecord.
As i said
2006 Nov 20
4
Production RAILS_ENV / DB Selection
Hey all,
I''m having some issues moving a project that incorporates Backgroundrb onto
a staging server... For some reason (surely of my own doing), my RailsBase
workers are insisting on using trying to access my development DB instead of
my "production" DB.
When I try to load a model object from within a worker, I get the following:
20061120-21:54:28 (26296)
2007 Feb 01
2
file_column 2nd try....
Looks like my first question a couple of days ago wasn?t very clever
asked, at least very sucessfull....
So, anyway...i will try it again:
I have to prefix that I am far away from fully understanding the overall
concept yet, and there?s no way to get some hints in the www so far, at
least my resaerches dont lead to any helpfull stuff.
image_controller.rb:
def create
MiddleMan.new_worker
2007 Jan 27
1
Memory leaks in backgroundrb
While debugging stale backgroundrb it became apparent that there''re
memory leaks in it. Here''s top object counts dump:
36715 String
6211 Array
5598 Proc
3150 Hash
1478 DRb::DRbObject
1313 Regexp
1272 Class
750 Thread
741 Socket
739 Slave
739 Slave::LifeLine
737 Process::Status
691 DrillReminderWorker
391 Module
160 Range
75 Gem::Version
2007 Oct 29
1
BackgrounDRb, Schedule and Clean Up
Hey all,
I''ve come accross BackgrounDRb and I have to say it''s a wounderful piece of software. It has the potential to solve so many of the problems that I am facing with a current RoR project.
Like many others I was having issues with the scheduling side of things, I noticed that hemant said there was a new version coming out. So I checked out the version from trunk, and have
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)
constraints = get_constraints(report,start_time,false)