async def connect(self) -> FCMXMPPConnection: connection = FCMXMPPConnection( sender_id=self.sender_id, api_key=self.api_key, loop=self.loop, ) await connection.connect() logger.info('Connection established (total: %d)', len(self.connections) + 1) return connection
def discard_connection(self, connection): logger.debug('Connection %s discarded', connection) self.connections.remove(connection) logger.info('Connection released (total: %d)', len(self.connections))