Forum: Ruby Pub/Sub in Distributed setup

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Vinay Kumar Jaasti (Guest)
on 2006-05-31 14:17
(Received via mailing list)
Hi,
I want to implement RCR 198 in distributed environment.I wrote
subscriber as
follows

require 'drb'
DRb.start_service()
a = DRbObject.new(nil,'druby://localhost:9000')
a.subscribe(:prof2 ) do |proxy|
proxy.method1 #this is a private method accessed thru proxy
 end

But it is giving me unknown method error...please help



thanks
----vinay
Logan C. (Guest)
on 2006-05-31 22:09
(Received via mailing list)
On May 31, 2006, at 6:17 AM, Vinay Kumar Jaasti wrote:

> end
>
> But it is giving me unknown method error...please help
>
>
>
> thanks
> ----vinay

Where's the other half of your code? What does the object that you
are connecting to look like?
Vinay Kumar Jaasti (Guest)
on 2006-06-01 08:19
(Received via mailing list)
class Abc < Object
   def method1
            puts "in Method 1"
   end
   def method2
            puts "in method 2"
    end
    publish :prof, :method1
   publish :prof2, :method2
end

where Object is implemented as in RCR198.
and I bounded object to drb as

require 'drb'
require 'PubSubServer'
server = Abc.new
DRb.start_service('druby://localhost:9000', server)
DRb.thread.join

Now, the client(code given below) is not able to fiqure out what proxy
is.How can i resolve this?

thanks
--vinay
Logan C. (Guest)
on 2006-06-02 22:49
(Received via mailing list)
On Jun 1, 2006, at 12:17 AM, Vinay Kumar Jaasti wrote:

>
> is.How can i resolve this?
>> > I want to implement RCR 198 in distributed environment.I wrote
>> > But it is giving me unknown method error...please help
>>
>


Could this just be a typo in your code?

a is subscribing to prof2 but then tries to call method1 (which is
published under prof)
Vinay Kumar Jaasti (Guest)
on 2006-06-03 09:24
(Received via mailing list)
Sorry for the typo.It should be method2
This topic is locked and can not be replied to.