async to coroutine change, AsyncEvent -> CoroEvent

This commit is contained in:
aewens 2019-05-18 17:29:06 +02:00
parent 4961e119b3
commit 4ddbc1c915
3 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
from abots.events.every import Every
from abots.events.threads import ThreadPool, ThreadMarshal, acquire_timeout
from abots.events.duodecimer import Duodecimer, Cron
from abots.events.async import AsyncEvent
from abots.events.coroutines import CoroEvent

View File

@ -1,6 +1,6 @@
from abots.helpers import coroutine
class AsyncEvent:
class CoroEvent:
def __init__(self):
self._set = False
self._targets = list()
@ -21,7 +21,7 @@ class AsyncEvent:
self._set = False
except GeneratorExit:
pass
def is_set(self):
return self._set

View File

@ -84,7 +84,7 @@ class SocketClient(Thread):
def _queue_thread(self, inbox, timeout):
while not self.kill_switch.is_set():
for message in self._obtain("inbox", timeout):
for message in self._obtain(inbox, timeout):
if self.broken.is_set():
self.reconnecting.wait()
self.send_message(message)
@ -151,7 +151,7 @@ class SocketClient(Thread):
def send(self, message):
self._inbox.put(message)
cast(self._bridge, "send", ("inbox", message))
cast(self._bridge, "send" ("inbox", message))
def connect(self, bridge):
self._bridge = bridge()