connection.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pyppeteer 作者: miyakogi 项目源码 文件源码
def send(self, method: str, params: dict) -> Awaitable:
        """Send message via the connection."""
        self._lastId += 1
        _id = self._lastId
        msg = json.dumps(dict(
            id=_id,
            method=method,
            params=params,
        ))
        logger.debug(f'SEND?: {msg}')
        asyncio.ensure_future(self._async_send(msg))
        callback = asyncio.get_event_loop().create_future()
        self._callbacks[_id] = callback
        callback.method = method  # type: ignore
        return callback
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号