Add new inhabitant callback

This commit is contained in:
Joscha 2018-07-27 12:21:33 +00:00
parent 6174fa6ff1
commit bd75d0ebba

View file

@ -56,6 +56,8 @@ class Room:
cookiejar cookiejar
) )
asyncio.ensure_future(self._inhabitant.created(self))
async def exit(self): async def exit(self):
self._status = Room.CLOSED self._status = Room.CLOSED
await self._connection.stop() await self._connection.stop()
@ -327,12 +329,15 @@ class Inhabitant:
# They're launched via asyncio.ensure_future(), so they don't block execution of the room. # They're launched via asyncio.ensure_future(), so they don't block execution of the room.
# Just overwrite the events you need (make sure to keep the arguments the same though). # Just overwrite the events you need (make sure to keep the arguments the same though).
async def disconnected(self, room): async def created(self, room):
pass pass
async def connected(self, room, log): async def connected(self, room, log):
pass pass
async def disconnected(self, room):
pass
async def join(self, room, session): async def join(self, room, session):
pass pass