Displaying 20 results from an estimated 30 matches for "drbundumped".
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 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 can''t ever pass a reference to such
object across...
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
Testing worker classes
...omeone
tells me why I shouldn''t, I am trying to call new_worker from a test
method in the test class generated by the worker generator. I''m
getting
NoMethodError: undefined method `[]'' for #<DRb::DRbUnknown:0xb72c7128>
I note in another thread that this is due to DRbundumped not being
included in the class that is causing the error. I took this to mean
that I need "include DRbundumped" in my test class, but that didn''t
work. I''m not sure where else I should include it. I know that
eventually I''ll need to put it in the non-test class...
2006 Sep 05
2
question about passing array of AR objects to worker
...class SearchController < ApplicationController
def start_search
@resources = Resource.find(:all)
logger.info @resources.inspect
session[:job_key] = MiddleMan.new_worker(:class => :search_worker,
:args => @resources)
end
end
class Resource < ActiveRecord::Base
include DRbUndumped
# attribute, "uri", string
end
now, my controller logs the array as:
[#<Resource:0xb79d9f58
@attributes={"uri"=>"http://www.google.com/search?hl=en&q=ruby+on+rails&btnG=Google+Search",
"id"=>"1"}>, #<Resource:0xb79d9ee0
@a...
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 07
4
Problems with ActiveRecord in workers
Hi *,
are there some special settings except of "load_rails: true" to make
ActiveRecord models accessible within my workers?
I''ve just installed the latest version of this great plugin, but I keep
getting
undefined method [] for #<DRb::DRbUnknown:0x12345> (line 105 in
backgroundrb.rb)
when one of the arguments for the worker is an ActiveRecord object.
I assume that
2007 Jan 15
6
Instantiating middleman and worker from inside a model?
In short: how (if possible) would i go about arranging it so that i
can instantiate a middleman and set a worker going from within a
method in one of my models? or is this a weird thing to be wanting to
do? (
My specific situation: I have an ''Image'' model in my application. An
actual image file associated with the model is being stored on
amazons s3 system.
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/se...
2010 Jun 30
0
drb problem? ringy-dingy won't answer...
...;distrib'' is true (the default) it runs right up to the call to
the server and right past it without getting to the server or raising
any errors.
Am using Ruby 1.8.6.26 , Ringy-Dingy 1.2.1, dj 1.8.4.
*********The server:
require ''rinda/ring''
class ScriptServer
include DRbUndumped
attr_accessor :result
def run(fullScript)
myTS = Time.now.strftime("%Y%m%d%H%M%S")
msg = "===> Starting #{scriptname} in run #{scriptrun} on
#{scriptenv} at #{myTS}"
puts msg
@result = "***#{scriptname} Launched [#{scriptlaunch}]"
rslt = ful...
2006 Feb 09
1
(no subject)
...b Service. Built in to the Rails framework. Interoperable
with other applications. Easy to get through firewalls/proxy. But I
don''t care about interoperability. How fast is XML marshaling/
unmarshaling? Probably requires that I recreate a subset of my domain
model in Structs.
DRb + DRbUndumped. Send ActiveRecords across as remote proxies. Easy
to set up. Faster than XML. Can re-use ActiveRecord. A bit tricky to
get right -- where is that method being called? Won''t every method
call be a remote call in this design? This fine-grained remote
interface approach didn''...
2006 Apr 08
3
[Tip] Application Wide Context Howto
...code and marshall the $application_wide_hash to disk as
Yaml or binary and then reload that when rails starts back up.
The objects or classes that you put in the AppServer cannot contain
procs, lambdas or anything else that cannot be marshalled by ruby and
drb. The way around this is to use DrbUndumped. I won''t go into
detail about that here but you can look up resources on how to do
this with google ;)
I have a full chapter on this technique in my forthcoming book that
goes into detail of what this process can be used for and what is
shouldn''t be used for. As well as...
2007 Aug 23
0
"interning empty string - (ArgumentError)" passing AR objects between workers
...hat need to be run at that time. For each job found, the
"dispatcher" spawns a "runner" worker that runs the job. So in my
"dispatcher" worker, I have some code like this:
MiddleMan.new_worker(:class => :runner_worker, :args => job)
I did add "include DRbUndumped" in my Job model, and it works fine
directly from the console. But from the "dispatcher" worker, I get the
following error (see full traceback attached):
"interning empty string - (ArgumentError)"
How can I get this to work? Is this a known bug? Or is what I am tryin...
2006 Dec 06
0
Testing your workers
...y_worker"
require "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib/backgroundrb.rb"
require ''drb''
class MarketSummaryWorkerTest < Test::Unit::TestCase
# Replace this with your real tests.
def test_truth
assert MarketSummaryWorker.included_modules.include?(DRbUndumped)
end
end
Throws error:
------------
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in
`const_missing'': uninitialized constant Worker (NameError)
from /home/hemant/ubac_webfront/config/../lib/workers/market_summary_worker.rb:9
from...
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 Jun 04
3
Database access for workers
Hi,
nice work on BackgrounDrb! I have a question, though:
What would be the best way to enable database access for a worker,
preferably through ActiveRecord models. Background: I''m trying to
write a worker that periodically gets data from an external source,
writes it to the database and is then displayed by Rails.
Anybody done something like this?
Thanks in advance!
ciao,
2006 Aug 26
0
DRbFire / ActiveRecord performances
Hi,
I''m using drbfire to send a "DRbUndumped" ActiveRecord object from the server to the client, through an ADSL line of 4Mbits/s download, and 600Kbits/s upload. I was afraid there would be too many round-trips between the client and the server, and unfortunately this is true:
Server code:
------------
#!/usr/local/bin/ruby
require &...
2007 Mar 07
10
MiddleMan.worker blocks?
...lock!
session[:xml_report_job] =
MiddleMan.new_worker(:class => :xml_report_worker, :args => args)
end
def get_progress
...
worker = MiddleMan.worker(session[job])
end
...
end
class XmlReportWorker < BackgrounDRb::Worker::RailsBase
include DRbUndumped
...
def do_work(args)
@progress = 0
@report_start_time = args[:start_time]
@report_params = args[:report_params]
constraints = args[:constraints]
dtd_only = args[:dtd_only]
io = Tmpfile.new(''csv_report'',''/var/tmp'')
@path =...