Displaying 20 results from an estimated 7000 matches similar to: "worker threads written in rubyinline"
2006 Nov 07
2
start a worker when bdrb starts
I am sure..again I am missing something, but I am trying to start a
worker, when backgroundrb starts and it doesn''t seem to work.
Here is my config/backgroundrb_schedules.yml file:
feed_worker:
class: feed_worker
job_key: feed_worker_key
worker_method: do_work
trigger_args:
repeat_interval: 20.minutes
I even tried this from Rails controller:
# def start_feed_worker
#
2006 Oct 25
0
Really long running worker threads and monitoring them
Hi,
I have been using Backgroundrb for quite sometime...and now...as i
guess its a known problem that...worker threads throw up..."Mysql
Connection has Gone away" error..when they run for really long time.
Is there any conclusive workaround or solution.
If not..and let''s say...my worker threads are not critically important
for my app....then which program you guys are using
2006 Nov 05
5
backgroundrb preview
Hi Ezra/skaar,
Wow man, the exercise was worth it. The connection closed problem with
socket as i mentioned in my earlier mails...completely disappeared,
and now i can connect only once to the socket and keep reading..till
end of its days.
Literally impossible with older release of backgroundrb.
This could also potentially solve the issues people were having with
ActiveRecord.
As i said
2006 Dec 06
0
Testing your workers
This has been asked before, never well attended perhaps.
Any thoughts on testing your workers?
Current implementation is broken. An empty test case like this:
require File.dirname(__FILE__) + ''/../test_helper''
require "#{RAILS_ROOT}/lib/workers/market_summary_worker"
require "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib/backgroundrb.rb"
require
2006 Oct 07
3
blog_id magic with typo
Hi All,
I am modifying typo so as, I can host multiple blogs on the same typo.
And its almost done, except that...i am stuck at one place.
When a user posts a new article, depending upon current blog_id, I
would like to set the blog_id attribute of @article object.
So..in the admin/content_controller.rb:
We have:
def new_or_edit
if request.post?
set_article_author
2006 Dec 15
3
how to install from svn?
When trying to run Chris samples I get error:
/usr/lib/ruby/gems/1.8/gems/mocha-0.3.2/lib/smart_test_case.rb:3:
uninitialized constant Test (NameError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
from /usr/lib/ruby/gems/1.8/gems/mocha-0.3.2/lib/mocha.rb:1
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:33:in
2007 Apr 04
2
unit tests?
Ezra et al:
I have this problem:
http://rubyforge.org/pipermail/backgroundrb-devel/2006-December/000578.html
Any progress on it? Or are unit tests simply impossible for now?
--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
2007 Feb 26
0
cross thread violation
recently i noticed in my mongrel log files:
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:374:
[BUG] cross-thread violation on rb_thread_schedule()
ruby 1.8.4 (2005-12-24) [i486-linux]
any ideas why?
With mongrel 1.0.1
--
gnufied
-----------
There was only one Road; that it was like a great river: its springs
were at every doorstep, and every path was its tributary.
2006 Nov 21
0
small tip for killing workers
People are still using cron jobs for killing one shot workers. I
mean...workers, which they want to run only once.
I guess putting a "exit 0" at the end of do_work is a better solution.
I use it and works great.
--
There was only one Road; that it was like a great river: its springs
were at every doorstep, and every path was its tributary.
2006 Oct 12
2
Too Many Mysql connections
In my app, for three models: foo,bar and baz, the database connection
is made to a different database and hence in model code:
class Foo < ActiveRecord::Base
establish_connection :diff_database
end
class Bar < ActiveRecord::Base
establish_connection :diff_database
end
class Baz < ActiveRecord::Base
establish_connection :diff_database
end
Now, the problem is, if is use the above
2006 Dec 15
5
Testing event driven Socket classes
Ok, here is the class, I want to Unit Test, its part of a large app
and is based on EventMachine library.
I want to mock the class TickServer ( i.e not stub it) . Since in
actual scenario, you can''t do this on this class:
@server = TickServer.new # will toss an exception at your face
you must initialize the server like this:
EventMachine.run {
2007 Mar 05
2
Scheduled workers only run once unless you call self.delete inside the worker
I had a worker scheduled to run every minute with
backgroundrb_schedules.yml:
ebay_runner:
:class: :ebay_auction_worker
:job_key: :ebay_auction_runner
:trigger_type: :cron_trigger
:trigger_args: 0 * * * * * *
This worker posts an auction to eBay from a queue of auctions every minute.
I was having a problem where the worker would run ok the first time, but
never any subsequent minutes
2007 Apr 18
5
[BUG] worker stopping abruptly
I have been facing this damn ugly issue since quite sometime.
So this worker reads RSS feed from Yahoo news and stores it in a DB.
The worker is scheduled to run at every 40 minutes and my
background_schedules.yml looks like this:
feed_worker:
:class: :feed_worker
:job_key: :feed_worker_key
:worker_method: :do_work
:trigger_args:
:start: <%= Time.now + 5 %>
2007 Dec 15
10
1) Error 2) sending request to a specific worker
Hello !
1) I have this error logged by bdrb:
undefined method `send_request'' for nil:NilClass
framework/packet_master.rb:58:in `ask_worker''
backgroundrb/server/master_worker.rb:59:in `process_work''
backgroundrb/server/master_worker.rb:16:in `receive_data''
backgroundrb/framework/bin_parser.rb:29:in `call''
backgroundrb/framework/bin_parser.rb:29:in
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
2006 Oct 11
0
storing typo sessions in memcache
I was trying to use memcache for session storage in Typo. And i got
following error, when user logs into the system.
Session ID:
Cookie set: is_admin=yes; path=/
Redirected to http://foobar.com:8002/admin/content
Completed in 0.02042 (48 reqs/sec) | DB: 0.00236 (11%) | 302 Found
[http://foobar.com/accounts/login]
undefined class/module User
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
2007 Dec 22
2
Implementation details for worker Queue
Hi All,
One can easily code a backgroundrb worker so as it can act as a worker
queue, having reached a stable status, perhaps its time we should add
this feature.
Why?
Because if you are already running your application using
BackgrounDRb, perhaps you don''t want to manage other solutions when
capability to do that is right there with you.
Interface?
This where i need feedback. You can
2006 Sep 03
1
Kill my Thread
Following code, should kill the worker thread, if there is a error in
connecting to the database, right?
but in my case it doesn''t and goes on doing other stuff. Of course...there
are lots of work arounds for this, but how do i make sure that, the thread
is killed at that point of time.
begin
@dbh = Mysql.real_connect
2007 Dec 08
3
Multiple Worker Methods on Different Schedules
Quick question: If I want to schedule different worker methods defined in
the same worker to trigger at different times, is this possible? Would the
following scheduler yaml work?
:schedules:
:foo_worker:
:worker_method: method1
:trigger_args: 0 */10 * * * * *
:job_key: some_key_1
:foo_worker:
:worker_method: method2
:trigger_args: 0 */15 * * * * *
:job_key: