Displaying 20 results from an estimated 1200 matches similar to: "mocking a few things in the test helper"
2007 Dec 19
6
thread_pooling sleeping
I''m trying to run a single worker 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
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
2008 Feb 01
3
Job Queue
After some initial stumblings, I think I''ve got the hang of
backgroundrb. It''s great! I''d been thinking for many many months how
cool something like this would be!
I''m trying to make a "job queue". That is, a pool of worker threads
monitor a queue. When a job appears, one of the workers grabs it and
executes the task. When complete, the worker
2008 May 09
1
register_status for excess thread_pool?
Hi,
Newbie here. I''ve got a worker (for generating PDF reports) that
uses the "thread_pool" to allow processing multiple reports
simultaneously and queue up any requests that exceed the thread
pool (pool_size = 10 currently).
def process_pdf(user)
thread_pool.defer(user) do |user|
makepdf(user)
end
end
My question is: I use a mutex to handle
2008 Jan 11
18
getting started
Hey all,
Been reading through all the old posts (and the docs) to familiarize
myself but I still feel a bit lost.
I''m on trunk and am having a bit of a hard time knowing where to start
with the particular I''m trying to solve.
So far, I''ve downloaded backgroundrb, done the basic rails setup,
created my worker and started it using `script/backgroundrb start`.
2007 Nov 02
10
pre-release version of backgroundrb available now from svn
Hi,
A pre-release version of backgroundrb is available now from svn.
Download it from here:
http://svn.devjavu.com/backgroundrb/branches/version099/
Since this release marks significant migration from existing
practices, i intend to keep trunk untouched for a while.
There are no install scripts, but you should copy "backgroundrb" file
from script directory of plugin to script
2008 Jan 13
3
right usage of bdrb
Hi,
i''m going to implement a syndication-service, which will get lists in
xml with some meta-data an enclosed video files, which will get encoded
at the end. The syndication run will be startet every five minutes of
a full hour.
So i thought to build 4 Worker. One for checking which feeds to
syndicate (syndication_worker) at a specific time, one for processing
the list
2008 Mar 19
2
problem with worker status
Hi,
I have a page were users can start jobs that may take several hours to
run. BackgrounDrb is perfect for me and seems to be working well most of
the time but some times I have the following problem:
My worker is set up like this:
class UploadWorker < BackgrounDRb::MetaWorker
set_worker_name :upload_worker
set_no_auto_load(true)
def create(args = nil )
file = args[:file]
2007 Dec 13
1
Possible Bug & Question
Hi there,
Amazing changes! I really like what you''ve done with BackgrounDRb and I hope
you continue developing it, since it was definitely somewhat languishing
before.
One small error stuck out for me, though. The create method requires an
argument even if one isn''t used, such that if you have:
def create
@results = Hash.new
end
The server throws an error about trying to
2008 Jun 27
2
Tests failing when using ''reload_on_schedule true''
Hi All,
When I add the line ''reload_on_schedule true'' to my worker, my tests
will no longer run with the following exception:
Starting ferret DRb
server.../Users/revelation/projects/revelation-project/config/../lib/workers/alert_worker.rb:3:
undefined method `reload_on_schedule'' for AlertWorker:Class
(NoMethodError)
class AlertWorker < BackgrounDRb::MetaWorker
2008 Jan 18
8
Query All Worker
What does the method query_all_workers() do? There is no documentation
on what this method returns (1.0.1 version).
Orion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080118/9f9b8112/attachment.html
2007 Nov 14
7
BackgrounDRb version 1.0RC1 available now
Hi Folks,
BackgrounDRb is a Ruby job server and scheduler. Its main intent is to be
used with Ruby on Rails applications for offloading long-running tasks.
Since a Rails application blocks while serving a request it is best to
move long-running tasks off into a background process that is divorced
from http request/response cycle.
This new release of BackgrounDRb is also modular and can be used
2007 Dec 10
21
BackgrounDRb 1.0 pre-release available now
Hi Folks,
We are glad to announce shiny new release of BackgrounDRb, which will
soon become 1.0.
A quick summary of changes:
- BackgrounDRb is no londer DRb, its based on event driven network
programming library packet ( http://www.packet.googlecode.com ) .
- Since we moved to packet, many nasty thread issues, result hash
corruption issues are totally gone. Lots of work has went in
making
2008 Jun 10
4
adding results from threads to a collection and returning it
Forgive me if this has been addressed somewhere, but I have searched and
can''t come up with anything.
I am basically trying to distribute several web page scraping tasks among
different threads, and have the results from each added to an Array which is
ultimately returned by the backgroundrb worker. Here is an example of what
I''m trying to do in a worker method:
pages =
2007 Dec 12
1
worker cleanup
I was using an older version of backgroundrb and today I started to
play with the most recent release. First up, I''d like to say, thanks
so much for this library and thanks for making it more stable. From
the looks of things, I think it''s going to be easier to use now than
it was several months ago when I first started using it.
I''d like to make sure I''m using
2007 Dec 17
11
BackgrounDRb release 1.0 available now
Hi Folks,
I am glad to announce 1.0 release of BackgrounDRb.
This would be a major release since 0.2 release of BackgrounDRb.
Here is a brief summary of changes:
- BackgrounDRb is DRb no longer. It makes use of EventDriven network
programming library packet ( http://packet.googlecode.com ).
- Since we moved to packet, many nasty thread issues, result hash
corruption issues are totally
2008 Jan 03
1
Thread_pool bug?
I have a previous question regarding long tasks and the thread_pool (sorry
for the dup, I didn''t see the first go through). To try and track things
down, I made a change based on a suggestion found in the archives. I moved
my import contacts worker to its own file and set the pool_size to 1.
class ImportContactsWorker < BackgrounDRb::MetaWorker
set_worker_name
2007 Dec 24
2
backgroundrb script crashing on startup
Everything works fine on my development box (Ubuntu 7.10, Ruby 1.8.6)
but on my server (Fedora Core 6, Ruby 1.8.5) when I run
script/backgroundrb start, the process fails to start.
This is with Rails 2.0.2 frozen in the app, and I have the most recent
version of the plugin (r297). Is Ruby 1.8.6 a requirement for
backgroundrb now? I can''t figure any other reason it would fail...
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
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