From Adrian.Klingel at illumaware.com Fri Nov 6 12:21:26 2009 From: Adrian.Klingel at illumaware.com (Adrian Klingel) Date: Fri, 6 Nov 2009 12:21:26 -0500 Subject: [Backgroundrb-devel] What is backgroundrb doing? Message-ID: How can I see what process is running? Everything in my installation runs great, but I don't have any way to see what is actually running. I thought I could query bdrd_job_queues, but the "finished" and "finished_at" columns are never updated. Even though the tasks do complete successfully. Am I supposed to update that table by hand? From toastkid.williams at gmail.com Fri Nov 6 12:49:13 2009 From: toastkid.williams at gmail.com (Max Williams) Date: Fri, 6 Nov 2009 17:49:13 +0000 Subject: [Backgroundrb-devel] What is backgroundrb doing? In-Reply-To: References: Message-ID: I experienced this - i added these lines to my worker classes to make them log properly BDRB_LOGGER = Logger.new("log/backgroundrb.log") STANDARD_LOGGER = Logger.new("log/#{RAILS_ENV}.log") def ldb(debug_text) string = "### #{caller[0]}: #{debug_text}" BDRB_LOGGER.debug(string) STANDARD_LOGGER.debug(string) end The ldb method can be called anywhere like this ldb "starting heavy_lifting job, arg_hash = #{arg_hash.inspect}" 2009/11/6 Adrian Klingel > How can I see what process is running? Everything in my installation runs > great, but I don't have any way to see what is actually running. I thought > I could query bdrd_job_queues, but the "finished" and "finished_at" columns > are never updated. Even though the tasks do complete successfully. Am I > supposed to update that table by hand? > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.maltz at picochannel.com Sat Nov 7 16:56:29 2009 From: ivan.maltz at picochannel.com (Ivan Maltz) Date: Sat, 7 Nov 2009 13:56:29 -0800 Subject: [Backgroundrb-devel] starting queued worker tasks immediately Message-ID: <3F0089DAF35245EBAF7072C09F324732@IvanT43p> My application performs a series of image processing tasks on photos. These are queued up for processing like this worker = MiddleMan.worker(:photo_worker) worker.enq_process_images(:arg => id, :job_key => "#{PHOTO_WORKER_KEY}_#{id}" ) The background processing is kicked off every minute, as specified in backgroundrb.yml :persistent_delay: 60 The images are processed in PhotoWorker like this def process_images(pid) photo = Photo.find(pid) photo.do_processing persistent_job.finish! # this task is done, start the next one check_for_enqueued_tasks end When adding a new task to an empty queue, I would like to start the background process immediately, rather than waiting till the next scheduled execution of the worker. How can I accomplish this? -Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rh at unlocktechnology.com.au Wed Nov 25 00:02:37 2009 From: rh at unlocktechnology.com.au (Ryan Harnwell) Date: Wed, 25 Nov 2009 16:02:37 +1100 Subject: [Backgroundrb-devel] undefined method `[]' for # Message-ID: <463761830911242102s6d21175cje7862ab37d1ed4f0@mail.gmail.com> Hi all, I am new to this mailing-list, hello everyone! I am receiving an error in rails ever since implementing BackgrounDRb. Please let me know if any information is missing and any help is greatly appreciated!!! Here is the code snippet: #application_controller.rb unless MiddleMan[:alerter] MiddleMan.new_worker(:class => :alert_worker,:job_key => :alerter) end # alert_worker.rb require 'XMPP4R' 'XMPP4R' class AlertWorker < BackgrounDRb::Worker::RailsBase set_worker_name :alert_worker def do_work(args) jid = Jabber::JID.new("username at gmail.com") # @client = Jabber::Client.new(jid, false) @client = Jabber::Client.new(jid) @client.connect @client.auth("password") @client.send(Jabber::Presence.new.set_show(:chat).set_status('BackgrounDRb!')) loop do @client.process sleep(1) end end def send_alert(title) to_jid = Jabber::JID.new('username at gmail.com') message = Jabber::Message::new(to_jid, title).set_type(:normal).set_id('1') @client.send(message) end end AlertWorker.register # my controller after_create :send_message def send_message MiddleMan.worker(:alerter).send_alert("hello") end -------------- next part -------------- An HTML attachment was scrubbed... URL: From ole.morten.amundsen at gmail.com Wed Nov 25 16:08:04 2009 From: ole.morten.amundsen at gmail.com (Ole Morten Amundsen) Date: Wed, 25 Nov 2009 22:08:04 +0100 Subject: [Backgroundrb-devel] Capistrano hang. Restart command of backgroundrb does not return "Command finished" Message-ID: <17e57ca90911251308r4ef54e09v5ecda7db133803ea@mail.gmail.com> Capistrano v2.5.9 backgroundrb 1.1 ruby 1.8.7 and rails 2.3.4 OK, my deploy.rb *before "deploy", "backgroundrb:stop" * after "deploy:update_code", "deploy:copy_production_configuration" after "deploy:symlink", "gems:install" *after "gems:install", "backgroundrb:restart"* Running the cap deploy: STOPPING backgroundrb works great, using the path of the running app * executing `deploy' triggering before callbacks for `deploy' * executing `backgroundrb:stop' * executing "cd /home/ubuntu/www/PowEst/current && script/backgroundrb stop" servers: ["powest.no"] [powest.no] executing command ** [out :: powest.no] Stopped BackgrounDRb worker with pid 27814 * command finished* * executing `deploy:update' RESTARTING doesn't return. I'll have to press ctrl -c triggering after callbacks for `gems:install' * executing `backgroundrb:restart' ** executing "cd /home/ubuntu/www/PowEst/current && script/backgroundrb restart"* servers: ["powest.no"] [powest.no] executing command ** [out :: powest.no] BackgrounDRb Not Running ** [out :: powest.no] Starting BackgrounDRb .... ^C*** [deploy:symlink] rolling back ... Logging in to the server and executing the very same command, works perfectly. Actually, if I define it after "deploy:restart", "backgroundrb:restart", so it doesn't roll back when hitting ^C, I find that the backgroundrb process is started on the server. Any suggestions? I love the simplicity of backgroundrb, I'm using it for daily tasks, as generating reports, e-mailing them and so on -FYI :) Ole Morten Amundsen 99 62 72 00 aliado.no olemortenamundsen.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From harini.r.iyer at gmail.com Thu Nov 26 23:25:14 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Fri, 27 Nov 2009 09:55:14 +0530 Subject: [Backgroundrb-devel] Unable to install backgroundrb using svn Message-ID: <404e0d6d0911262025i6d680938k64fcd0e7cf3d548f@mail.gmail.com> Hi, I am new to BackgroundRB and I am trying to install backgroundRB settings for my application. I am using Eclipse and InstantRails. I am following the instructions and i did the following. 1. gem install chronic packet -> This worked fine. 2. svn co http://svn.devjavu.com/backgroundrb/trunk -> However when I tried to download the code from the subversion, it threw an error saying that the connection was closed by the server. Is there any other place I can download the backgroundrb from? (Other than using git and piston) Thanks for the help, Harini -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at thewilliams.ws Fri Nov 27 00:08:30 2009 From: adam at thewilliams.ws (Adam Williams) Date: Fri, 27 Nov 2009 00:08:30 -0500 Subject: [Backgroundrb-devel] Unable to install backgroundrb using svn In-Reply-To: <404e0d6d0911262025i6d680938k64fcd0e7cf3d548f@mail.gmail.com> References: <404e0d6d0911262025i6d680938k64fcd0e7cf3d548f@mail.gmail.com> Message-ID: <7E98A343-403A-47A6-8779-D2DB4DD5BE35@thewilliams.ws> On Nov 26, 2009, at 11:25 PM, harini iyer wrote: > Is there any other place I can download the backgroundrb from? (Other than using git and piston) I'm pretty sure you're going to need to use the code from the github repository, http://github.com/gnufied/backgroundrb. There is a download button on that page if you are not willing to use git. HTH, Adam From harini.r.iyer at gmail.com Sun Nov 29 01:00:59 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Sun, 29 Nov 2009 11:30:59 +0530 Subject: [Backgroundrb-devel] Problems with starting the backgroundrb server - Permission denied Message-ID: <404e0d6d0911282200g791f8905n8fee66974303878d@mail.gmail.com> Hi, I am using eclipse and instant rails. I am trying to start the backgroundrb server by the folowing script ruby script/backgroundrb start On doing a stack trace, it shows me an error in backgroundrb_tasks.rb on the line if File.exists?(scripts_src) `#{scripts_src}/start -d` Can anyone tell me what could be the possible reason? I tried removing -d, but no use. Thanks, Harini -------------- next part -------------- An HTML attachment was scrubbed... URL: From harini.r.iyer at gmail.com Mon Nov 30 03:20:14 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Mon, 30 Nov 2009 13:50:14 +0530 Subject: [Backgroundrb-devel] Unable to make the cron job work Message-ID: <404e0d6d0911300020t4b09de03v97765ca5dfd6e11f@mail.gmail.com> Hi, I am a newbie to BDRB and I am kind of stuck. I installed the plugin from svn://rubyforge.org//var/svn/backgroundrb Is there a better place to get the code? And I wrote the following cron job in backgroundrb.yml scheduled_emails: :class: :EmailingWorker :job_key: :scheduled_emails :worker_method: :do_work :worker_method_args: nil :trigger_args: :start: <%= Time.now + 5.seconds %> :repeat_interval: <%= 5.seconds %> EmailingWorker is my worker class as shown class EmailingWorker < BackgrounDRb::Rails def do_work(args) # This method is called in it's own new thread when you # call new worker. args is set to :args logger.info('In do_work') hello_world end def hello_world logger.info('Hello World') end end When I start the backgroundrb server, nothing gets logged in the backgroundrb.log nor does it throw any errors. Am I missing something here? I am running apache and mysql servers through instant rails. I am really in need of some help here, I have been stuck at this point since 2 days. I would be thankful if someone could point out the mistake that I could be making. Thank You, Harini -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at thewilliams.ws Mon Nov 30 07:18:58 2009 From: adam at thewilliams.ws (Adam Williams) Date: Mon, 30 Nov 2009 07:18:58 -0500 Subject: [Backgroundrb-devel] Unable to make the cron job work In-Reply-To: <404e0d6d0911300020t4b09de03v97765ca5dfd6e11f@mail.gmail.com> References: <404e0d6d0911300020t4b09de03v97765ca5dfd6e11f@mail.gmail.com> Message-ID: <174BE38C-3463-447E-B94C-92AC9341B9C3@thewilliams.ws> In the documentation at http://backgroundrb.rubyforge.org, it says you should be using git://github.com/gnufied/backgroundrb.git On Nov 30, 2009, at 3:20 AM, harini iyer wrote: > Hi, > > I am a newbie to BDRB and I am kind of stuck. I installed the plugin from > > svn://rubyforge.org//var/svn/backgroundrb > > Is there a better place to get the code? > And I wrote the following cron job in backgroundrb.yml > > scheduled_emails: > :class: :EmailingWorker > :job_key: :scheduled_emails > :worker_method: :do_work > :worker_method_args: nil > :trigger_args: > :start: <%= Time.now + 5.seconds %> > :repeat_interval: <%= 5.seconds %> > > EmailingWorker is my worker class as shown > > class EmailingWorker < BackgrounDRb::Rails > > def do_work(args) > # This method is called in it's own new thread when you > # call new worker. args is set to :args > logger.info('In do_work') > hello_world > end > > def hello_world > logger.info('Hello World') > end > end > > > When I start the backgroundrb server, nothing gets logged in the backgroundrb.log nor does it throw any errors. Am I missing something here? I am running apache and mysql servers through instant rails. I am really in need of some help here, I have been stuck at this point since 2 days. I would be thankful if someone could point out the mistake that I could be making. > > Thank You, > Harini > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel From harini.r.iyer at gmail.com Mon Nov 30 14:42:51 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Mon, 30 Nov 2009 14:42:51 -0500 Subject: [Backgroundrb-devel] Unable to make the cron job work In-Reply-To: References: <404e0d6d0911300020t4b09de03v97765ca5dfd6e11f@mail.gmail.com> Message-ID: <404e0d6d0911301142m3d6d907n70b9132893087f40@mail.gmail.com> I am working on windows. And it appears to me taht certain code follows syntax for linux. Will this still work for windows? Thanks, harini On Mon, Nov 30, 2009 at 4:24 AM, Lee Hambley wrote: > Harini, > > Try Github for the code, perhaps it is newer. Are you running the > backgroundrb daemon? 'script/backgroundrb start' > > -- Lee Hambley > > Twitter: @leehambley | @capistranorb > Blog: http://lee.hambley.name/ > Working with Rails: http://is.gd/1s5W1 > > > 2009/11/30 harini iyer > >> Hi, >> >> I am a newbie to BDRB and I am kind of stuck. I installed the plugin from >> >> svn://rubyforge.org//var/svn/backgroundrb >> >> Is there a better place to get the code? >> And I wrote the following cron job in backgroundrb.yml >> >> scheduled_emails: >> :class: :EmailingWorker >> :job_key: :scheduled_emails >> :worker_method: :do_work >> :worker_method_args: nil >> :trigger_args: >> :start: <%= Time.now + 5.seconds %> >> :repeat_interval: <%= 5.seconds %> >> >> EmailingWorker is my worker class as shown >> >> class EmailingWorker < BackgrounDRb::Rails >> >> def do_work(args) >> # This method is called in it's own new thread when you >> # call new worker. args is set to :args >> logger.info('In do_work') >> hello_world >> end >> >> def hello_world >> logger.info('Hello World') >> end >> end >> >> >> When I start the backgroundrb server, nothing gets logged in the >> backgroundrb.log nor does it throw any errors. Am I missing something here? >> I am running apache and mysql servers through instant rails. I am really in >> need of some help here, I have been stuck at this point since 2 days. I >> would be thankful if someone could point out the mistake that I could be >> making. >> >> Thank You, >> Harini >> >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harini.r.iyer at gmail.com Mon Nov 30 23:19:13 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Tue, 1 Dec 2009 09:49:13 +0530 Subject: [Backgroundrb-devel] How to make the UNIXSocket work on Windows Message-ID: <404e0d6d0911302019v464ec9d0v71434570ba10e430@mail.gmail.com> Hi, Win32-utils doesnt seem to have an interface for sockets. When I give the 'ruby script/backgroundrb start' , I got an error in master_packet.rb saying that UNIXSocket unimplemented. This was understood since I am working on Windows Vista. However, I tried Socket.socketpair which did not work either. Is there a workaround for this? Is there a patch available for starting the backgroundrb server on windows? I installed the win32-utils and I am still stuck on the UNIXSocket.pair() error in the packet module. Thank You, Harini -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin.wood at trifectagis.com Mon Nov 30 23:32:18 2009 From: justin.wood at trifectagis.com (Justin Wood) Date: Tue, 1 Dec 2009 17:32:18 +1300 Subject: [Backgroundrb-devel] How to make the UNIXSocket work on Windows In-Reply-To: <404e0d6d0911302019v464ec9d0v71434570ba10e430@mail.gmail.com> References: <404e0d6d0911302019v464ec9d0v71434570ba10e430@mail.gmail.com> Message-ID: <95a868280911302032y41070070lf87c001dddcd266@mail.gmail.com> I did a lot of messing around and installed cygwin and that worked. On Tue, Dec 1, 2009 at 5:19 PM, harini iyer wrote: > Hi, > > Win32-utils doesnt seem to have an interface for sockets. When I give the > 'ruby script/backgroundrb start' , I got an error in master_packet.rb saying > that UNIXSocket unimplemented. This was understood since I am working on > Windows Vista. However, I tried Socket.socketpair which did not work either. > Is there a workaround for this? > Is there a patch available for starting the backgroundrb server on windows? > I installed the win32-utils and I am still stuck on the UNIXSocket.pair() > error in the packet module. > > Thank You, > Harini > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > -- Justin Wood Senior Software Architect New Zealand Office, 57 Wellington Street, Freemans Bay, Auckland, New Zealand M +64 27 225 0749 | P +64 9 370 0168 | F +64 9 361 6504 E justin.wood at trifectagis.com | Free: 0800 trifecta Skype: nztrifecta www.trifectagis.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From harini.r.iyer at gmail.com Mon Nov 30 23:34:39 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Tue, 1 Dec 2009 10:04:39 +0530 Subject: [Backgroundrb-devel] How to make the UNIXSocket work on Windows In-Reply-To: <95a868280911302032y41070070lf87c001dddcd266@mail.gmail.com> References: <404e0d6d0911302019v464ec9d0v71434570ba10e430@mail.gmail.com> <95a868280911302032y41070070lf87c001dddcd266@mail.gmail.com> Message-ID: <404e0d6d0911302034j1490bc60l9bb0a3d4bbeae9e4@mail.gmail.com> I have cygwin. Can you please tell me how to run this application on cygwin. I am using eclipse radrails(aptana). I open a command shell of the project and give the commands. How do I do this in cygwin? Thanks, Harini On Tue, Dec 1, 2009 at 10:02 AM, Justin Wood wrote: > I did a lot of messing around and installed cygwin and that worked. > > On Tue, Dec 1, 2009 at 5:19 PM, harini iyer wrote: >> >> Hi, >> >> Win32-utils doesnt seem to have an interface for sockets. When I give the >> 'ruby script/backgroundrb start' , I got an error in master_packet.rb saying >> that UNIXSocket unimplemented. This was understood since I am working on >> Windows Vista. However, I tried Socket.socketpair which did not work either. >> Is there a workaround for this? >> Is there a patch available for starting the backgroundrb server on >> windows? I installed the win32-utils and I am still stuck on the >> UNIXSocket.pair() error in the packet module. >> >> Thank You, >> Harini >> >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > -- > Justin Wood > Senior Software Architect > > > New Zealand Office, > 57 Wellington Street, > Freemans Bay, > Auckland, > New Zealand > > > M ?+64 27 225 0749 ?| ?P ? +64 9 370 0168 ?| ?F ? +64 9 361 6504 > E ? justin.wood at trifectagis.com ?| ?Free: ? ?0800 trifecta > Skype: ?nztrifecta > > www.trifectagis.com > From harini.r.iyer at gmail.com Mon Nov 30 23:41:44 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Tue, 1 Dec 2009 10:11:44 +0530 Subject: [Backgroundrb-devel] How to make the UNIXSocket work on Windows In-Reply-To: <404e0d6d0911302034j1490bc60l9bb0a3d4bbeae9e4@mail.gmail.com> References: <404e0d6d0911302019v464ec9d0v71434570ba10e430@mail.gmail.com> <95a868280911302032y41070070lf87c001dddcd266@mail.gmail.com> <404e0d6d0911302034j1490bc60l9bb0a3d4bbeae9e4@mail.gmail.com> Message-ID: <404e0d6d0911302041m618db6c4n30701c98ead72ac3@mail.gmail.com> I forgot to add one thing which is that the application I am trying to build the asynchronous process (a cron job) for needs instant rails to run the apache and mysql server. I read that Unix doesnt support InstantRails. What do i do about it? It is like, I need the best of both the worlds :) Thanks for the help!! Harini On Tue, Dec 1, 2009 at 10:04 AM, harini iyer wrote: > I have cygwin. Can you please tell me how to run this application on > cygwin. I am using eclipse radrails(aptana). I open a command shell of > the project and give the commands. How do I do this in cygwin? > > Thanks, > Harini > > On Tue, Dec 1, 2009 at 10:02 AM, Justin Wood > wrote: >> I did a lot of messing around and installed cygwin and that worked. >> >> On Tue, Dec 1, 2009 at 5:19 PM, harini iyer wrote: >>> >>> Hi, >>> >>> Win32-utils doesnt seem to have an interface for sockets. When I give the >>> 'ruby script/backgroundrb start' , I got an error in master_packet.rb saying >>> that UNIXSocket unimplemented. This was understood since I am working on >>> Windows Vista. However, I tried Socket.socketpair which did not work either. >>> Is there a workaround for this? >>> Is there a patch available for starting the backgroundrb server on >>> windows? I installed the win32-utils and I am still stuck on the >>> UNIXSocket.pair() error in the packet module. >>> >>> Thank You, >>> Harini >>> >>> _______________________________________________ >>> Backgroundrb-devel mailing list >>> Backgroundrb-devel at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >> >> >> >> -- >> Justin Wood >> Senior Software Architect >> >> >> New Zealand Office, >> 57 Wellington Street, >> Freemans Bay, >> Auckland, >> New Zealand >> >> >> M ?+64 27 225 0749 ?| ?P ? +64 9 370 0168 ?| ?F ? +64 9 361 6504 >> E ? justin.wood at trifectagis.com ?| ?Free: ? ?0800 trifecta >> Skype: ?nztrifecta >> >> www.trifectagis.com >> >