1. Ronny Pfannschmidt
  2. execnet-patches

Commits

Ronny Pfannschmidt  committed 5d61f80

first preps for remote io

  • Participants
  • Parent commits ffb3312
  • Branches default

Comments (0)

Files changed (3)

File io-on-remote

View file
+# HG changeset patch
+# Parent 19fcb47ca792a89f8479401b57e568c6f77c33d3
+
+diff --git a/execnet/gateway_io.py b/execnet/gateway_io.py
+--- a/execnet/gateway_io.py
++++ b/execnet/gateway_io.py
+@@ -87,3 +87,40 @@ def create_io(spec):
+         io.remoteaddress = spec.ssh
+         return io
+ 
++RIO_DATA = 0
++RIO_KILL = 1
++RIO_WAIT = 2
++RIO_REMOTEADDRESS = 3
++
++class RemoteIO(object):
++    def __init__(self, iochan, controllchan):
++        self.iochan = iochan
++        self.controllchan = controllchan
++
++    def read(self, nbytes):
++        #XXX: we will do the dirty thing and asume messages are received in correct size batches
++        pass
++
++    def write(self, data):
++        self.channel.send(data)
++    
++    def kill(self):
++        self.channel.send(RIO_KILL)
++
++    def wait(self):
++        self.channel.send(RIO_REMOTEADDRESS
++
++
++def serve_remote_io(channel):
++    class PseudoSpec(object)
++        pass
++    spec = PseudoSpec()
++    spec.__dict__.update(channel.receive)
++    io = create_io(spec)
++
++    def callback(data):
++        if isinstance(data, int):
++
++
++if __name__ = "__channelexec__":
++    serve_remote_io(io, channel)

File io-readwrite-message

View file
+# HG changeset patch
+# Parent 19fcb47ca792a89f8479401b57e568c6f77c33d3

File series

View file
 bootstrap-split
 unify-process-based-bootstrap
 socket-io-creation-split
+io-readwrite-message
+io-on-remote