Displaying 20 results from an estimated 26 matches for "ask_status".
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...
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, ask...
2009 Jan 06
1
ask_status/register_status deprecated???
Hi,
I''ve been using bdrb for a while and just recently found the need to use the
ask_status/register_status functionality of my worker.
This is the error I get whenever the register_status method is encountered:
...lib/workers/session_worker.rb:10:in `create'': undefined method
`register_status'' for #<SessionWorker:0xb6e7d52c> (NoMethodError)
from
/home/ru...
2007 Dec 22
1
Backgroundrb Question
If I have a worker and everything set up and I call:
MiddleMan.ask_status(:worker => :foo_worker)
MiddleMan.ask_status(:worker => :foo_worker)
MiddleMan.ask_status(:worker => :foo_worker)
three times in quick succession. Will the tasks be queued up and
executed as the previous one finishes? Or is this going to ignore the 2
bottom requests? How does this work?...
2007 Dec 19
6
thread_pooling sleeping
...ker 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
My worker is something like:
class FooWorker < BackgrounDRb::MetaWorker
set_worker_name :foo_worker
def create(args=nil)
@mutex = Mutex.new
@mutex.synchronize do
@statuses = {}
register_status(@statuses)
end
end
de...
2008 Jan 09
6
[PATCH] x 2 - Fix for "null pointer exception" when ask_status is called before worker is run, and docfixes
Sorry for attaching patches in emails to the mailing list, but I''m still
unable to login to Devjavu for Backgroundrb (I''m able to login just fine for
Merb''s Devjavu and submitted a ticket successfully).
Anyway, I encountered a bug when trying to #ask_status of a worker before
it''s run (or rather, before its result_hash has been set to something). Not
sure why it''s no longer being initialized to an empty hash (since
http://backgroundrb.devjavu.com/changeset/279). I''ve attached a patch,
defaults_for_packet_master.diff for this...
2008 Jan 26
4
Connections
I''m checking out backgroundrb for a calculation process I estimate will take
2-3 minutes and be ran on-demand only via Rails. Very easy and slick.
But I have a question.
The connections never close, if I do a netstat they just keep piling up.
Do I need to do some housekeeping somewhere? I noticed the @
connection.close statements are commented out in favor of a # FIXME type
deal.
2008 Mar 19
2
problem with worker status
...ask for a new worker like this:
>> jk = MiddleMan.new_worker(:worker => :upload_worker, :job_key =>
"123", :data => data)
(where data = {:file => some_file} )
most of the time I get the jobkey returned and the job works and I can
ask the status with
>> MiddleMan.ask_status(:worker => :upload_worker, :job_key => "123")
But sometimes I get the jobkey returned from the initial request but the
worker seems to fail to register its status. In some cases the job is
actually running though but not always. I don''t understand what could be
causing thi...
2008 Apr 14
6
Good news: BackgrounDRb now works on Windows
...ou can''t be sure without testing.
Since I haven''t figured out how to run automated tests I have created some
ad hoc tests of my own. These cases work:
- ad hoc scheduling by calling a method on the worker
- passing parameters to the worker
- cron scheduling
- register_status and ask_status
- making a synchronous call and getting a result back kind of works, except
I get the whole hash back with the result in the :data key instead of just
getting the result alone. In other words I get a hash like this:
{:type=>:response, :client_signature=>25, :result=>true, :data=>1}...
2007 Dec 22
0
[Fwd: Re: what happened to get_worker?]
...:worker_method => :echo_value,
>> :job_key => @job_key,
>> :data => {:param1 => ''val1'',:param2 => ''val2'' })
>>
>>
>> To retrieve the worker, I have tried:
>>
>> @worker = MiddleMan.ask_status(:worker => :bar_worker, :job_key =>
>> @job_key)
>>
>> but it does not work. I used to be able to do this with get_worker. Can
>> someone explain how to use this feature with the new version?
>>
>>
>
> What happens, you get an error?
> Ok,...
2008 Jan 03
0
daemon use-case questions
...script/backgroundrb status" and get my status back. I can submit a patch
for this if anyone else is interested.
However, I noticed while writing that patch, that query_all_workers() seems
to be broken in the trunk r302 (status for all workers is always nil). So my
workaround for now is to use ask_status():
t_response = MiddleMan.query_all_workers
t_response.each {|k,v| puts "#{k}: #{MiddleMan.ask_status(:worker =>
k)}" }
Anyhoo, that''s it. That really rambled on longer than I thought it would.
Please let me know if I can clarify any of my questions, and thanks to...
2008 Jun 10
3
Backgroundrb fixes for transfering large amounts of data
...@data << pack_data
extracter_block.call(@data.join)
@data = []
@parser_state = 0
@length_string = ""
@numeric_length = 0
extract(remaining,&extracter_block)
end
end
The second problem we hit was ask_status repeatedly returning nil. The
root cause of this problem is in the read_object method of the
BackgrounDRb::WorkerProxy class when a data record is large enough to
cause connection.read_nonblock to throw the Errno::EAGAIN exception
multiple times. We changed the code to make sure read_nonblock is...
2008 Jan 11
18
getting started
...el like I need a long-running worker
necessarily. From the docs, it seemed like I could call:
MiddleMan.ask_work(:worker => :sales_processor, :worker_method
=> :do_work, :data => @upload.id)
In the :do_work method, I''m calling register_status but am receiving
nil when I call ask_status
I guess I just feel like I''m shooting in the dark here - not sure if
i''m going in the right direction at all. Should I be using ask_work
with register_status? Perhaps send_request (though I don''t want the
http request to wait for the worker to be completed)? Does t...
2008 Jan 10
8
Worker suicide
I have a worker which wants to delete itself after it finishes its
work- how can it do that?
Best Regards,
Danny Burkes
2007 Dec 13
1
Possible Bug & Question
...like so:
def CorrelatorWorker < BackgrounDRb::MetaWorker
set_worker_name :correlator_worker
def create(arg)
@results = Hash.new
end
def correlate(user_id)
# This stuff takes awhile...
@results[user_id] = progress
register_status(@results)
end
end
So in my code I can say
MiddleMan.ask_status(:worker=>:correlator_worker)[user_id]
to find the progress of correlations for a single user. But the previous
version of BackgrounDRb did have one big advantage in that each worker was a
separate thread. In this version, when I start correlations for one user,
the correlator_worker blocks until...
2007 Dec 21
7
Using my models
I''m working on upgrading my app to the latest version of backgroundrb.
Everything went find until I tried to execute my tasks.
Here is my simple worker for testing:
class MscWorker < BackgrounDRb::MetaWorker
set_worker_name :msc_worker
def create(args = nil)
# this method is called, when worker is loaded for the first time
end
# Send a message to everyone
def
2007 Nov 02
10
pre-release version of backgroundrb available now from svn
...normally invoked when
you receive requests from rails. But there is a exception, in each
worker there is a method called "register_status" available, which can
be invoked from workers to register their status with master.
Now, from rails, you can query status of a worker using
MiddleMan.ask_status(:worker => :foo_worker)
All the status requests are server by master itself and hence
"process_request" inside worker will not be invoked for them.
You will find support for schedules very rough around the edges.
Reason is, You can use
add_periodic_timer(5) { foo_job }
to do any ki...
2008 Mar 25
0
Questions about backgroundrb
...the view if I''m using workers? It''s
> important for the UI to show crawled content periodically to show a more
> detailed progress "indicator" in the view.
Just generate xml/json and save as status/result objects for the
worker and then query the data back using ask_status method of a
worker.
>
> In one of your posts, you mention:
> " When you are processing too many tasks from rails, you should use inbuilt
> thread pool, rather than firing new workers"
> ...We are planning to have 100s of web crawlers being initiated and thus
> periodica...
2007 Dec 17
7
Get "some read error" on calls to worker
I''m running the latest from svn (rev 285). I''ve been having a problem
launching a process repeatedly. What happens is that I get a debug
message "some read error" and then the worker refuses to run again.
I''ve stripped my worker down to just doing a puts and it still happens.
Like the other threads I want to launch my workers as needed, however I
get the
2007 Nov 14
7
BackgrounDRb version 1.0RC1 available now
...;10+10")
You can also use register_status as described in following snippet
to register status of
your worker with master, which can be directly queried from rails.
register_status(some_status_data)
From rails, you can query status object using following code:
MiddleMan.ask_status(:worker => :foo_worker)
Above code would return status object of ''foo_worker''. When you call
register_status
from a worker, it replaces older state of the worker with master.
Since, master process
stores status of the worker, all the status queries are served by
master i...