blob: 6545bc413eada7bb8007d04f634deb51ba8564e3 [file] [log] [blame]
Adam Israeldcdf82b2017-08-15 15:26:43 -04001
Adam Israeldcdf82b2017-08-15 15:26:43 -04002class AsyncRunner:
3 async def __call__(self, facade_method, *args, **kwargs):
4 await self.connection.rpc(facade_method(*args, **kwargs))
5
6
7class ThreadedRunner:
8 pass
9
10# Methods are descriptors??
11# get is called with params
12# set gets called with the result?
13# This could let us fake the protocol we want
14# while decoupling the protocol from the RPC and the IO/Process context
15
Adam Israel1a15d1c2017-10-23 12:00:49 -040016# The problem is leaking the runtime impl details to the top levels of the API
17# with async def By handling the Marshal/Unmarshal side of RPC as a protocol we
18# can leave the RPC running to a specific delegate without altering the method
19# signatures. This still isn't quite right though as async is co-op
20# multitasking and the methods still need to know not to block or they will
21# pause other execution