As long as all libraries use the same eventloop, they will work well together. In this case, it seems that all the libraries you have selected are based on asyncio (excetp gawel IRC lib, which is no longer available). So there are no problems. There is one eventloop (and no threads), and all is well.
The problem that you are facing is that you will have multiple “servers” in the same event loop, or rather, there are several coroutines that handle input from the outside world. One coroutine handles HTTP traffic, and the other handles IRC traffic. In pseudo-code, it can be translated into the following:
import asyncio
@asyncio.coroutine
async def irc_server():
async with irc_connect('irc.freenode.net#python-fr') as irc:
async for message in irc:
@asyncio.coroutine
async def web_server():
async with web_connect('localhost:8080') as web:
async for request in web:
loop = asyncio.get_event_loop()
loop.create_task(irc_server())
loop.create_task(irc_server())
loop.run_forever()
, . HTTP- IRC, - . - , , . - :
import asyncio
value = None
@asyncio.coroutine
async def irc_server():
global value
async with irc_connect('irc.freenode.net#python-fr') as irc:
async for message in irc:
if message == 'echo':
irc.send(value)
else:
value = message
@asyncio.coroutine
async def web_server():
global value
async with web_connect('localhost:8080') as web:
async for request in web:
if request.path == 'echo':
request.client.send(value)
else:
value = request.path
loop = asyncio.get_event_loop()
loop.create_task(irc_server())
loop.create_task(irc_server())
loop.run_forever()