Displaying 20 results from an estimated 2000 matches similar to: "Problems with ActiveRecord in workers"
2007 Apr 05
4
backgrounddrb problem..
i''m having some problems getting a simple example going with
backgrounDRB.
after i set my worker to work i try to get back the result like this:
w = MiddleMan.worker(key)
w.items comes back as DRb::DRbUnknown (i have items as attr_reader in
my worker and access it inside there with @items). the result is
actually activerecord results in an array. when i change it so my
worker puts
2006 Aug 03
3
undefined method `'' for #<DRb::DRbUnknown:0x2501bd4>
I tried installing BackgrounDRb today. Followed the readme, made a
little worker for myself and executed it within the code. But I keep
getting this error. I must''ve gone over the README a zillion times.
Any idea what it is?
undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>
2006 Jul 19
1
A couple of problems
Hi Ezra,
Thanks for the great work on BackgrounDRb. I have come across a
couple of problems.
1. I wanted to define a simple class in the worker file to wrap up and
pass back some data to my controller. It seems that if I create the
class either inside or outside of my worker class (in the same file)
it gets wrapper by a DRb::DRbUknown object and therefore cannot be
accessed from my controller.
2006 Jul 05
5
''m having trouble with BackgrounDrb
Hi. I thought that BackgrounDrb was the perfect solution for my long
running report production tasks.
But I can''t seem to get anything useful back out of it.
I set up a simple test worker that just does
class TestWorker < BackgrounDRb::Rails
attr_reader :pupil
def do_work(args)
@progress=0
@pupil=Pupil.find(3)
sleep rand*10
@progress=100
end
when I try to
2006 Jun 15
12
Multithreading and DB access in Rails
I just tried writing some controllers, etc. that would allow me to start
and monitor background tasks running in new (Ruby) threads, with the
idea that I''d eventually manage long-running indexing processes that
way. I can kick off such threads OK (by using Thread.new in a routine
called by a controller), but it seems like Rails gets huffy if those
background tasks and the ordinary
2006 Jul 19
1
Testing worker classes
Hi,
Does it make sense to test a worker class by calling
Middleman.new_worker? Or should I just be testing the functionality in
the do_work method, with, say, a mock object. This seems like a really
ugly DRY violation: you''d need to keep the code in the mock and the
real worker in sync.
That''s the philosophical half of my question. In fact, until someone
tells me why I
2006 Feb 09
1
(no subject)
My application has one central database + Rails server and many
distributed GUI clients. The remote clients need to read and update
different collections of ActiveRecords. They also need to submit
fairly demanding calculation + database update requests.
Have you designed a similar Ruby application? What did you do?
I''ll try to summarize the approachs I''m considering
2006 Sep 25
3
Engine Yard blog
Just received the news from Tom Mornini.
Congrats Ezra for the new Engine Yard site and the blog you will be
collaborating.
Hope to read you there soon.
http://www.engineyard.com/
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060925/3f251fa4/attachment.html
2006 Aug 08
2
"include DRbUndumped" error
Hi,
I am getting my hands on trying the cool BackgrounDrb plugin.
Following various discussions and suggestsion, I included "include DRbUndumped"
in my ActiveRecord model. However, the following exception occurs
after I tried this and hit the page that uses this model. Does anyone
know why this is so? Is it possible that an object cannot be
DRbUndumped (that would mean, we
2006 Sep 05
2
question about passing array of AR objects to worker
got a wierd problem maybe someone can help with.
whenever i try to pass an array or AR objects to my worker, i end up
with a DRb object in the worker...here''s an example
class SearchWorker < BackgrounDRb::Rails
attr_reader :resources
def do_work(resources)
logger.info resources.inspect
end
end
class SearchController < ApplicationController
def start_search
2006 Jul 22
1
Problem with drbundumped?
I''m not sure if this is a problem or not, but it definitely henders
the way one would use the passing of objects to the drb server. Isn''t
the point of passing objects to the drb server to act like its
passing to just another local method? When I pass an object to the
drb server a lot of the useful methods are gone. Such as id() or class
() or inspect(), etc. I spent a
2006 Jul 19
1
Passing objects to drb, does it keep the existing db connection?
I have a simple question. Let''s say I do this in one of my models:
after_save
drb_conn.some_method(self)
end
When that object gets over to the background process is it the exact
same as?....
Model.find some_id #in the background process
As far as my background process is concerned passing the object is
not any different than passing the id and using the find method?
Because
2006 Jul 25
1
can''t dump: session wierdness
Hi,
I have "include DRbUndumped" in one of my model classes. Whenever my
app accesses the session I get the following:
can''t dump
/usr/lib/ruby/1.8/drb/drb.rb:395:in `_dump''
/usr/lib/ruby/1.8/pstore.rb:349:in `dump''
/usr/lib/ruby/1.8/pstore.rb:327:in `transaction''
/usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update''
2006 Apr 08
3
[Tip] Application Wide Context Howto
Friends-
I see more and more folks wanting an application wide context object
that will work regardless of server software(webrick,mongrel, fcgi''s,
scgi''s) This can be a very useful technique if done correctly. Here
is a little info that I have gleaned on a great way to do this type
of thing.
-----Easy AppServer----------------
An easy way to get yourself an
2007 Aug 08
3
Cannot start workers in production mode
I have a job that I am starting from a Rails controller in production mode
using MiddleMan:
MiddleMan.new_worker(:class => :import_ccg_category_worker, :args => {
:category_id => @category.id, :remote_category_id =>
params[:remote_category_id], :description => "Importing CCG products for #{@
category.name}" })
Both of the category ID variables are just basic integers. I
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 Nov 11
5
undefined method `add''
We''ve been running into problems with ferret indexing lately. The
problem is intermittent and some times it persists. Just got this after
wiping the index and redeploying:
NoMethodError (undefined method `add'' for Solution:Class):
(druby://10.1.65.87:9009)
/data/releases/20071111152414/vendor/rails/activerecord/lib/active_record/base.rb:1238:in
`method_missing''
2006 Jul 19
1
Catch 22 with after_save. Please help.
I have a pretty strange problem. Here is basically what I have to
demonstrate my problem:
class Event < ActiveRecord::Base
def after_create
AnotherClass.find_event(id)
end
end
class AnotherClass < ActiveRecord::Base
def self.find_event(event_id)
e = Event.find event_id
end
end
Here is the catch 22 and it''s quite annoying. Basically ActiveRecord
puts to whole save
2006 Nov 01
1
strange issue with backgroundrb behind apache/lighttpd
I''m getting strange data back from my worker whenever I run our rails
app with more than one dispatcher under lighttpd.
just to give some info on what the app does:
user submits data to rails app. rails app hands off data to worker,
which goes and does it''s thing, storing results in an array of
response objects (the array is an attribute of the worker). the
response object
2006 Sep 24
5
Can''t Connect to BackgroundRB
I''m having trouble getting backgroundrb up and running in a
production environment.
Here''s my backgroundrb.yml:
---
port: "22222"
timer_sleep: 60
load_rails: true
environment: production
host: XXX.XX.XXX.50
database_yml: config/database.yml
acl:
deny: all
allow: localhost 127.0.0.1 XXX.XX.XXX.51
order: deny,allow
I start BackgroundRB from XXX.XX.XXX.50 with