X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=modules%2Flibjuju%2Fjuju%2Fclient%2Frunner.py;fp=modules%2Flibjuju%2Fjuju%2Fclient%2Frunner.py;h=6545bc413eada7bb8007d04f634deb51ba8564e3;hb=e2051cca7dac12aa09f6ed33555dcc4548c4b52b;hp=0000000000000000000000000000000000000000;hpb=9d18c22a0dc9e295adda50601fc5e2f45d2c9b8a;p=osm%2FN2VC.git diff --git a/modules/libjuju/juju/client/runner.py b/modules/libjuju/juju/client/runner.py new file mode 100644 index 0000000..6545bc4 --- /dev/null +++ b/modules/libjuju/juju/client/runner.py @@ -0,0 +1,21 @@ + +class AsyncRunner: + async def __call__(self, facade_method, *args, **kwargs): + await self.connection.rpc(facade_method(*args, **kwargs)) + + +class ThreadedRunner: + pass + +# Methods are descriptors?? +# get is called with params +# set gets called with the result? +# This could let us fake the protocol we want +# while decoupling the protocol from the RPC and the IO/Process context + +# The problem is leaking the runtime impl details to the top levels of the API +# with async def By handling the Marshal/Unmarshal side of RPC as a protocol we +# can leave the RPC running to a specific delegate without altering the method +# signatures. This still isn't quite right though as async is co-op +# multitasking and the methods still need to know not to block or they will +# pause other execution