File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ import trio
2
+ import click
3
+ import tractor
4
+ import pydantic
5
+ # from multiprocessing import shared_memory
6
+
7
+
8
+ @tractor .context
9
+ async def just_sleep (
10
+
11
+ ctx : tractor .Context ,
12
+ ** kwargs ,
13
+
14
+ ) -> None :
15
+ '''
16
+ Test a small ping-pong 2-way streaming server.
17
+
18
+ '''
19
+ await ctx .started ()
20
+ await trio .sleep_forever ()
21
+
22
+
23
+ async def main () -> None :
24
+
25
+ proc = await trio .open_process ( (
26
+ 'python' ,
27
+ '-c' ,
28
+ 'import trio; trio.run(trio.sleep_forever)' ,
29
+ ))
30
+ await proc .wait ()
31
+ # await trio.sleep_forever()
32
+ # async with tractor.open_nursery() as n:
33
+
34
+ # portal = await n.start_actor(
35
+ # 'rpc_server',
36
+ # enable_modules=[__name__],
37
+ # )
38
+
39
+ # async with portal.open_context(
40
+ # just_sleep, # taken from pytest parameterization
41
+ # ) as (ctx, sent):
42
+ # await trio.sleep_forever()
43
+
44
+
45
+
46
+ if __name__ == '__main__' :
47
+ import time
48
+ # time.sleep(999)
49
+ trio .run (main )
You can’t perform that action at this time.
0 commit comments