File: test_proxy.rst

package info (click to toggle)
execnet 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: python: 5,244; makefile: 78; sh: 2
file content (25 lines) | stat: -rw-r--r-- 746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Managing proxied gateways
==========================

Simple proxying
----------------

Using the ``via`` arg of specs we can create a gateway
whose io is created on a remote gateway and proxied to the master.

The simplest use case, is where one creates one master process
and uses it to control new workers 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, thread model, 0 active channels>
    >>> worker = group.makegateway()
    >>> worker
    <Gateway id='gw0' receive-live, thread model, 0 active channels>
    >>> group
    <Group ['master', 'gw0']>