Displaying 20 results from an estimated 4000 matches similar to: "rendering from within a 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 Nov 14
1
couple of questions
I''m using the latest backgroundrb. Do I need to setup a worker in
order to use it with Rails?
I remember using "Worker::RailsBase" before.
Also, how do I access the logger from within the worker?
Thanks a lot!
--
Lalo
2006 Nov 07
1
scheduled jobs with cron
I''m very interested in using backgroundrb for running jobs every n minutes.
The release notes say that this functionality is not yet ready via
backgroundrb. But I wonder, can I call backgroundrb with a ruby script
from cron ?
I know I could create a cron job that calls lynx (or whatever) on a
specific page that will call backgroundrb, but I want to know if there
other
2006 Aug 01
2
actionmailer cant find template in backgroundrb
Im trying to send mails from a backgroundrb worker and it seems like
ActionView cant find my template. same code works as a rake task.
here my worker:
class StatusMailWorker < BackgrounDRb::Rails
repeat 1.minutes # <-- hehe!
def do_work(args)
[...blah...]
NotificationMailer.create_daily_report(users, rep, items)
end
end
end
its throwing the following error:
No
2006 Aug 07
9
problems with ActionMailer
Hi all,
I''m trying to create a worker to send a mail to all the users in my
db. Right now I''m doing the tests, this is the code in my worker
(Masivo is the ActionMailer subclass):
def do_work(args)
@progress = 0
@logger.info("MAILER: starting job")
records = Record.find(:all)
total = records.size
records.each_with_index do |record, idx|
2007 Mar 29
1
Extending the to_s method
Hi!
I''m developing an localization plugin (just for my own purposes) and I
wanted to extend the to_s method for the Time class.
What I want to do:
when someone does date.to_s(:short) that a localized version of
the :short date is displayed.
But I don''t know how to accomplish this. I know have this:
class Time
def to_s(option)
print option.to_yaml
2007 Sep 29
1
templates with same name before extension are cached
Hi all,
I was just wondering if this is the intended behavior. Here is my setup:
controller
def index
respond_to do |f|
f.xml { render :xml => true }
f.html { render :layout => :none }
end
end
In my views I have a file for each type
index.herb
index.xerb
The first request I send is cached and interferes with the other one.
For example, if I send an xml request
2009 Apr 22
1
how can I get the friends of a fb user only using his facebook id
hello,
with facebooker can I get a list of someone''s facebook friends, only using
his facebook id?
If yes, then please let me know how... (and don''t read further)
If this is not possible, then here is my problem:
-------------------------------------------
I have a flash movie embedded in the canvas page of my Facebooker
application.
The movie gets information from an xml
2006 Dec 12
2
RXML partial question
All,
I have a RXML template which renders partial RXML templates within it.
A snippet is below. The "xml" variable is the parent template''s Builder
variable. It is passed into the partial under the name "parent_xml".
Why can''t I use :locals => {.... :xml => xml ....} in my call to render
the partial? It seems like if I do use :xml => xml, it
2005 May 01
5
Example using Builder::XmlMarkup and .rxml files?
Greetings,
I''m a newby to both "R"s in RoR. I would like to use Builder::XmlMarkup
to generate my pages. If there is a working downloadable example
somewhere, that would probably be enough. Otherwise, here''s what
I want to do:
With the following controller:
class AccountsController < ApplicationController
layout ''accounts''
model :account
2008 Apr 20
1
Why is respond_to always rending the RXML view?
I''m having a problem in Rails 2 where respond_to is always rendering the
RXML view even in the HTML rendering response. Can anyone tell me why
this might be happening? Here''s a code snippet:
respond_to do |accepts|
accepts.html
accepts.xml { render :action => ''show.rxml'', :layout => false}
end
If I change this to the following it works fine:
2006 Jul 26
1
mixing ebr and builder together and having it render as html in the browser
The first problem is that if you make a builder or .rxml file it always
displays as xml in a browser. declare! it and the browser gives and error
and if you change rxml to rhtml then it thinks you should be making erb. SO
quetion #1 is how do I make builder files render in the browser as html.
The next thing that I want to be able to do is be able to render parcials or
call other files of other
2006 Aug 30
1
Shouldn't rxml files be exempt from layout by default?
RJS templates are the only template type that are exempt from layout
by default.
Don''t you think it makes sense to add rxml to the list of exempt
extensions? I''d assume most people would be surprised to see their
XML embedded in the middle of their (most probably) rhtml layout.
http://dev.rubyonrails.org/svn/rails/trunk/actionpack/lib/
action_controller/base.rb:
2007 Apr 26
2
looking for a worker that''s gone
In my app, I store the job key when a worker is fired off and then
check back in periodically to see how its doing. The workers delete
themselves when they''re done. I would expect when I try to get a
worker that has been deleted, I would get nil or a proper exception,
but instead I get:
>> MiddleMan.worker(''foobar'')
NoMethodError: undefined method
2006 Apr 17
7
Serve static XML files how?
Hi,
a Javascript in one of my Rails templates needs to load a static XML
file. I tried several places to put the actual XML file, and I also
tried to make the file a rails template (tried both .rhtml and .rxml)
and access it via a controller action. None of these ways worked. Does
the lighttpd server know how to serve XML files, or do I need to
configure it first? Or, is there a good workaround?
2006 Nov 08
3
0.2.0 worker/slave creation
We ran into some problems accessing a freshly created worker, and had to
insert a sleep of 1 second to get it to work. It looks like Ezra and skaar
already know this:
from middleman.rb:
# HACK: there is a race in the worker/slave creation, we
# currently need to sleep between create.
sleep 0.1
You might want to increase it to 1 second for those of us on slowly mac
books.
2006 May 08
8
RSS Feed / xml.link problem?
I''m having an odd problem. I''m trying to create an RSS feed (working off the
Recipe), but "xml.link" generates error about "Can''t convert Hash to
String". From the error trace, it *looks* like it''s calling the a fileutil
''link'' method (as in, filesystem symbolic link) - even xml.tag! generates
this error.
Er, how do I make
2006 Aug 07
2
uninitialized constants in worker class
I am new to this list and relatively new to the backgroundrb plugin,. So
first i will say hello to everybody here, especially to Ezra
Zygmuntowicz!
I played a little bit with a dummy worker and so far everything worked
well.
But now i want to do real work in a worker but now i get that error[1].
It looks like that the constants configured in environment* configs are
not available to the worker
2007 Dec 18
5
querying status of worker with job_key
Hi,
Is it possible to start a worker with job_key and then ask_status of that
specific worker with the job_key?
MiddleMan.ask_work(:worker => :auth_worker, :job_key=>''1'',
:worker_method => :auth)
and then
MiddleMan.ask_status(:worker => :auth_worker, :job_key=>''1'')
>From my testing of the new backgroundrb, asking status using job key
2007 Dec 18
1
Backgroundrb crash calling ask_status when worker not running
When I call ask_status on a worker that has not been started I get and
exception of type BackgrounDRb::BdrbConnError, which is fine. I can deal
with that, but I also find that the backgroundrb process dies as well.
The scenario is simple: Call ask_status on a worker that is not auto
loaded. I used a job_key, in case that makes a difference.
-------------- next part --------------
An