Commits

Ronny Pfannschmidt committed 10ce9a9

finishing touches

Comments (0)

Files changed (7)

 # HG changeset patch
-# Parent 8e59db1f886eb16bcc28c382cb3916b8f4ae86f0
-introduce creating a io on a gateway and proxying to it
+# Parent 22fc532353781cd4a02a2c8e5d4ae84a1db46ddb
+add suport for proxying a io via another gateway
 
 diff --git a/conftest.py b/conftest.py
 --- a/conftest.py
  class Popen2IOMaster(Popen2IO):
      def __init__(self, args):
          self.popen = p = Popen(args, stdin=PIPE, stdout=PIPE)
-@@ -87,3 +91,79 @@ def create_io(spec):
+@@ -87,3 +91,81 @@ def create_io(spec):
          io.remoteaddress = spec.ssh
          return io
  
 +    def wait(self):
 +        return self._controll(RIO_WAIT)
 +
++    def __repr__(self):
++        return '<RemoteIO via %s>' % (self.iochan.gateway.id, )
 +
 +
 +def serve_remote_io(channel):
 # HG changeset patch
-# Parent 17efa3f77a9ce8f9bf4fce3859c29083bb5e9b3a
+# Parent 8876f2f1acc7ffffce4518e4a0a7114a66152927
 enhance tracing for message writing in case of io fail
 
 diff --git a/execnet/gateway_base.py b/execnet/gateway_base.py
+# HG changeset patch
+# Parent 3289095ada78ea774877e86a416ecc33e664ec80
+add a simple proxying example
+
+diff --git a/doc/example/test_proxy.txt b/doc/example/test_proxy.txt
+new file mode 100644
+--- /dev/null
++++ b/doc/example/test_proxy.txt
+@@ -0,0 +1,28 @@
++Managing Proxyed gateways
++==========================
++
++Simple Proxying
++----------------
++
++Using the via arg of specs we can create a gateway
++whose io os created on a remote gateway and
++proxyed to the master.
++
++The simlest use case, is where one creates one master process
++and uses it to controll new slaves and their environment
++
++::
++
++    >>> import execnet
++    >>> group = execnet.Group()
++    >>> group.defaultspec = 'popen//via=master'
++    >>> master = group.makegateway('popen//id=master')
++    >>> master
++    <Gateway id='master' receive-live, 0 active channels>
++    >>> slave = group.makegateway()
++    >>> slave
++    <Gateway id='gw0' receive-live, 0 active channels>
++    >>> group
++    <Group ['master', 'gw0']>
++
++
+diff --git a/doc/examples.txt b/doc/examples.txt
+--- a/doc/examples.txt
++++ b/doc/examples.txt
+@@ -12,6 +12,7 @@ Note: all examples with `>>>` prompts ar
+ 
+    example/test_info.txt
+    example/test_group.txt
++   example/test_proxy.txt
+    example/test_multi.txt
+    example/hybridpython.txt
+    example/test_debug.txt
 socket-io-creation-split
 io-on-remote
 topologic-shutdown
-test-remote-shutdown
 message-writing
+remote-docs
 shutdown-testing
 # HG changeset patch
-# Parent 189f37d3a60b363e8f755bdd9dd552773d007351
+# Parent c0d845d4d5b78f9d57799d38b7f53bae4f1b26bd
 some tests for terminaton, strange
 
 diff --git a/testing/test_termination.py b/testing/test_termination.py

test-remote-shutdown

-# HG changeset patch
-# Parent 4f8c04469c761884cf3843b68ce0561884950c1d
-test how a remote gateway shuts down when its proxying gateway dies
-

topologic-shutdown

 # HG changeset patch
-# Parent 0b929d167a8c9d84955c193832f8bf3ebb898423
+# Parent f8f2a943349da4826f355d573364f7c5fee54cef
 ensure gateways shut down before their io proxy is shut down
 
+this change adds up timeouts for every level of nesting
+
 diff --git a/execnet/multi.py b/execnet/multi.py
 --- a/execnet/multi.py
 +++ b/execnet/multi.py