-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtester.py
49 lines (35 loc) · 992 Bytes
/
tester.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import asyncio
from misc.message_manager import MessageManager
import logging
from misc import exceptions, message as msg
import subprocess
import os
logging.basicConfig(level=logging.DEBUG)
async def test_task():
while True:
print("läuft")
await asyncio.sleep(1)
async def start():
m = MessageManager()
message = msg.Request("as", "asd", 1)
m.add_request(message)
t = asyncio.create_task(test_task())
input("irgendwas: ")
while True:
print("while")
await asyncio.sleep(1)
async def start2():
fut = asyncio.get_event_loop().create_future()
# fut.set_result("RESULT")
fut.set_exception(exceptions.RequestTimeout)
try:
await fut
e = fut.exception()
print(e)
# status = fut.result().status
print("status")
except exceptions.RequestTimeout:
print("Request timeout")
# asyncio.run(start2())
# subprocess.Popen('./start_middleware.py')
# os.system('obs')