[execnet-dev] Persistent sessions
Dima Tisnek
dimaqq at gmail.com
Mon Oct 14 22:45:54 CEST 2013
rick, I believe stateless server is by design.
the workaround I used was to have the server ping the client and
client send next command within the context of responding to this ping
message.
there might be a more elegant solution, perhaps involving generators.
in the end it really depends what you are trying to do.
On 14 October 2013 13:40, Rick Gerkin <rick1 at gerkin.org> wrote:
> Is there anyway to make the contents of the interpreter persist between
> calls to remote_exec? For example,
>
> import execnet
> gw = execnet.makegateway("popen//python=jython")
> ch1 = gw.remote_exec('var=2; channel.send(var)')
> ch1.receive() # Prints 2.
> ch2 = gw.remote_exec('channel.send(var)')
> ch2.receive() # NameError: name 'var' is not defined.
>
> I would expect the gateway to correspond to one continuous python session,
> but I guess it doesn't?
>
> Rick
>
>
>
>
>
>
> _______________________________________________
> execnet-dev mailing list
> execnet-dev at python.org
> https://mail.python.org/mailman/listinfo/execnet-dev
>
More information about the execnet-dev
mailing list