Hello Rui Ma,
you're fast ! Looks very neat.
> Ruote-rest is the current way to use ruote engine in a multiprocess
> environment. But developers need to write code to take care of the
> underlying communication between models and ruote-rest server.
>
> A DRb ruote server provides an alternative way to deploy ruote in a
> multiprocess environment. The primary benefit of using it is that developers
> can still use ruote as the way of ruote-web2 client code, without
> adding/chaning client code for multiprocess depolyment.
>
> Another concern is that using TCP/UNIX socket might be faster than
> initiating internal HTTP requests in terms of the ruote server/client
> communications.
>
> I am not sure either ruote-rest or drb server is thread-safe. Maybe the
> only way to provide ruote with a thread-safe multiprocess environment is to
> implement workitem level lock.
Since I'm working on ruote 2.0 and making sure multiprocess
deployments do not interfere with ruote, I worked on locking access to
scheduler queues (so that timeouts and such scheduled events get
triggered on time and only once for the whole pack of engines) and to
tracker queues (so that a listen expression (not very often used, I
know) is triggered once for the whole pack of engines).
For workitems themselves, thread-safe measures brought by
active-record itself should suffice.
> I put together DRb server/client code here:
> http://github.com/ruima-nyc/ruote-web2
>
> running it:
>
> cd ruote-web2
> ruby script/ruote_server.rb
> ruby script/server
>
> Rui Ma
> http://rui.ma
Well done,
John
Hello Enrico,
I have no experience with drb, but let me ask for a few
clarifications, maybe that'll explain Rui Ma for a further reply.
Do you have a detailed stack trace for that "undefined method" issue ?
Maybe you could show the piece of code where the error occurs.
Do I guess correctly when I say that the error occurs on the remote
(engine) side ?
> I know that this particular participant never instantiates any new
> objects, so I think this might be happening when the participant
> itself is being instantiated and passed the workitem by ruote.
Participants are instantiated at registration time.
> Should participants be defined and registered when the engine starts
> up instead of the app? How would those participants then access the
> application models?
I guess it's bit hard to push the work to a "remote" engine and then
expect the participants to interact with "local" models. Thorny issue
indeed.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
Hello Enrico,
the "inside the ProcessError log" is a capital piece of information ;)
>> > I know that this particular participant never instantiates any new
>> > objects, so I think this might be happening when the participant
>> > itself is being instantiated and passed the workitem by ruote.
>>
>> Participants are instantiated at registration time.
>
> Strange, because if that's the case then why did the error occur
> during the process? *puzzled*
Maybe the "participant was trying to instantiate something" and not
"something was trying to instantiate the participant". You gave us no
stacktrace, no real info about the target of the "new" method ;)
> But in good news, I did get the participants to work, in the end. I
> shuffled code around so that the DRb process was defining and
> registering them instead of the application. Somehow that "Just
> Works." Now I'm just finding that any expressions that use the
> scheduler are not getting fired.
Ouch. Kind of a edgy setup that you have.
Well done !