Type:
Class
Gateway id conversion forms a gateway between different DRb protocols or networks.
The gateway needs to install this id conversion and create servers for each of the protocols or networks it will be a gateway between. It then needs to create a server that attaches to each of these networks. For example:
1 2 3 4 5 6 7 8 9 10 11 | require 'drb/drb' require 'drb/unix' require 'drb/gw' DRb.install_id_conv DRb::GWIdConv. new gw = DRb:: GW . new s1 = DRb::DRbServer. new 'drbunix:/path/to/gateway' , gw s1.thread.join s2.thread.join |
Each client must register services with the gateway, for example:
1 2 3 4 | DRb.start_service 'drbunix:' , nil # an anonymous server gw = DRbObject. new nil , 'drbunix:/path/to/gateway' gw[ :unix ] = some_service DRb.thread.join |