similar to: render_to_string from within the worker?

Displaying 20 results from an estimated 10000 matches similar to: "render_to_string from within the worker?"

2007 Nov 25
2
Fwd: Render_to_string from a worker
Hi, I am trying to generate a PDF from within a worker using PDF::Writer. In my controller I use render_to_string to create the pdf file however from what I understand render_to_string can only be used from a controller. Does anybody have any suggestions how I might be able to replicate this functionality in a worker? -- thanks, Felix -------------- next part -------------- An HTML attachment
2006 Dec 03
0
worker is not executed
Hey, I''ve got a problem where my worker is not being properly executed.... it used to work in an earlier version of brb, but i realized my vendor/plugins was out of whack, upgraded to the newer schedule- oriented release (0.2.1). I can start brb, and run the new_worker middleman, but ntohing happens. When putting brb in ''run'' mode, i see this: undefined method
2008 Jan 31
2
cron scheduling problem
I''m running a fresh checkout of release 1.0.1 ... It''s now 11:32 am local time on January 31. I''ve configured a single worker for a test. If I use the following schedule in my background.yaml file: :schedules: :debugger_worker: :ping: :trigger_args: 0 35 11 * * * * Backgroundrb starts up without error. If I make the following
2008 Jun 14
0
does BackgrounDRB not "know" the rails environment it is running within/in parallel with?]
Hi, it probably is a noob question but I''m confused by this error message: active_support/dependencies.rb:478:in `const_missing'': uninitialized constant Invoice::ApplicationController Situation: I have an InvoicesController with a create method that in turn calls upon a MiddleMan.worker(:billing_worker), which in turn finds an Invoice and calls upon @invoice.print_invoice
2008 Sep 08
2
Problems with async worker request
Sorry if this comes through twice. I already sent this once, before joining the mailing list. I''m attempting to use Backgroundrb to handle asynchronous pdf creation, but in doing so, I''ve run into a very strange problem. Below is a method that''s called from the controller which creates a new worker, then grabs the worker and calls the ''build_pdf''
2007 Aug 23
2
Render partial from Backgroundrb worker?
Hi, I have a long running task which generates JavaScript to files and I am hoping to move this to a backgroundrb worker. The javascript is currently generated with call to render_to_string: File.open(File.join(target_folder, ''all.js''), "w") do |file| file.puts(render_to_string :partial => ''partials/shared/javascript/tags'', :locals => {
2007 May 04
1
Setting environment
> Chris T wrote: > > Not sure this is known behaviour but it seems that if want to set > the > > environment to, for example, test, and you want to use Active > Record you > > have to both explicitly set the RAILS_ENV and the BackgrounDRb > environment. > > I ran into essentially the same problem (needing to run BRB in the > test > environment so
2007 Jul 09
2
limiting processor usage
I have a very intensive background process that keeps taking up loads of the cpu. If I have 2 of these going at once, I can''t even ssh to the box much less get a page to load. Is there something I can do to limit this. I dont mind if the process takes longer to run, I just dont want to freeze my box every time it runs. Thanks for any advice! Charlie -------------- next part
2006 May 26
8
calling render_to_string outside of controller
How can I call render_to_string outside of a controller. I''m stuck on this. I''ve nearly got my plugin finished but I can''t seem to get this to work. The method is in ActionController::Base but it is protected. -- Posted via http://www.ruby-forum.com/.
2007 Feb 12
1
-c switch in the startup command
I have been strugging with getting backgroundrb to stay in the correct environment using multiple configuration files and the -c switch when starting backgroundrb. If I start brb like this: ./script/backgroundrb run RAILS_ENV=development -- -c ../config/development_background.yml where development_background.yml specifies "development" for rails_env and environment, the first worker
2006 Nov 21
1
rendering from within a worker
I''m using backgroundrb for its scheduled jobs. Now, a job that runs on a daily basis creates an xml file that I currently create with an .rxml template. Can I run a controller action from within a worker ? Can I render() a template from within a worker ? Sorry, I haven''t grasped the whole rails/backgroundrb relationship so I don''t know what I can and not do. Thanks
2007 Jun 04
2
backgroundrb scheduler
I''ve been having a terrible time with the backgroundrb scheduler. The issues I''m having is that the scheduled actions aren''t ran at all and if they do, the process stays around forever. I''m using the backgroundrb as a nightly cron to run some accounting operations. questions: 1. How can I have the process destroyed after the worker completes? 2. Any idea on
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
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 Feb 15
0
disregard RE: new syntax for autostart and repeat
So disregard this question. I followed Mason Hale''s suggestion that I pass in some worker_args and all is well in the scheduler.yml file. Brian _____ From: Brian Lucas [mailto:blucasCO at gmail.com] Sent: Thursday, February 15, 2007 2:49 PM To: ''backgroundrb-devel at rubyforge.org'' Subject: new syntax for autostart and repeat Hello: I''m a
2007 Feb 21
0
accessing controller methods from backgreoundrb
Hi all, I am trying to use backgroundrb to cache a set of controller actions that are quite processor expensive (there is some pretty heavy xml processing going on). In my rails app I have page caching set up to observe the appropriate controllers and models and all works well. However when model changes occur in a backgroundrb process the cache sweeper isn''t notified of the changes
2007 Mar 08
0
worker cant delete?
Hi, I get the following error from my client program when I try to call delete after my worker is completed: goten at goten-server:~/projects/svn_working/m29svn_back/app$ ruby backup_app.rb {:done=>true, :txt=>["piping to tmp", "piping done", "getting youngest", "youngest got", "destfile
2008 Sep 15
3
Best way to run hundreds of concurrent tasks?
Hi all, I''m trying to figure out to run some asynchronous tasks in a Facebook app. I''ve got things working, but BRB crashes after a little while, and I''m not sure if my setup is ideal. Here''s the scenario: - whenever a user visits my app, I need to fire off a bunch of API calls. - these calls need to start right away, because the user sees a
2006 Dec 01
0
Worker won''t start work
(Sorry my last email had the wrong subject) Hi, I''ve just installed background rb 0.2.1. When I try start a worker in my application controller I receive the following error: wrong number of arguments (2 for 1) - (ArgumentError) /home/chris/projects/call_manager/trunk/call_manager_app/vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb:211:in `initialize''
2007 Jun 06
2
struggling with stability
Greetings all, Unit tests are passing, but I''m having mucho problems getting brb to run without exceptions for more than 6 hours. I''m seeing a mixture of the following 2 exceptions: 20070605-11:26:56 (21497) failed to find slave socket - (RuntimeError) 20070605-11:26:56 (21497) /usr/local/lib/ruby/gems/1.8/gems/ slave-1.2.1/lib/slave.rb:435:in `initialize''