Hi,
I have a question regarding RoR and DRb. First of all, I tested with
simple client/server examples and everything worked as expected. I have
the following lines in my environment.rb:
DRb.start_service
$rem_obj = DRbObject.new(nil, “druby://#{rname}:9001”)
Since rem_obj is a global variable, I can call it from any controller
and the invoked procedure is run on the server.
However, what if you want the client to be registered as an observer.
How is that gonna work in rails? I imagine that an observer has to be
running continously, and since rails can only serve page requests how
can it also listen to the server’s events? Do you have to create a
listener object which runs in a separate thread or process?
I actually made this work by adding the following line in the
controller’s initialize() function: DRb.start_service, but I don’t
understand why this works. After the page got served, what process is
still running the observer?
Thanks,
Tiberiu