Commit 2cc35ce9 authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

now I know how to use asyncio

parent 635ee025
......@@ -24,4 +24,12 @@ def register_out(plugin):
def run():
for proto in in_protocols:
coros = []
for proto in in_proto_insts:
coros += proto.coros()
for out in out_plugins:
coros += out.coros()
asyncio.gather(coros, loop=event_loop)
import asyncio
from collections import defaultdict
from PyIRC.extensions import bot_recommended
from import IRCProtocol
......@@ -67,8 +68,9 @@ class IRC:
netinst = IRCNetwork(**args)
self.network_instances[network] = netinst
coro = netinst.connect()
def coros(self):
return [inst.connect for inst in self.network_instances.values()]
def push(self, project, push):
\ No newline at end of file
......@@ -20,7 +20,9 @@ class HTTPProtocol():
self.server = loop.create_server(,
'', int(config['http']['port']))
def coros(self):
return [self.server]
def get_handler(self, request):
"""Handle GET."""
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment