aboutsummaryrefslogtreecommitdiffstats
path: root/toys/de/derb/de.rb
blob: f0d6a410d9279c843f35c555ec80755f12f601f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$:.unshift File.dirname(__FILE__)

require 'drbssh' # local file

class De_hosts_thread
    def initialize(host)
        @remote = DRbObject.new_with_uri("drbssh://_sd/ruby")


class De_hosts
    def initialize(hosts)
        DRb.start_service 'drbssh://'
        # create one thread per host
        @remotes = []

    def execute(obj, args, callback_done)
        # XXX threaded
        @remotes.each do |r|
            r.eval("%s(%s)" % [obj.to_str, args.to_str)
        end