async_run_magic.py 文件源码

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

项目:async-ipython-magic 作者: leriomaggio 项目源码 文件源码
def on_connected(self, f):
        """Callback fired /on_connection/ established.

        Once the connection to the websocket has been established,
        all the currenct namespace is pickled and written to the
        corresponding web_socket connection.
        """
        try:
            ws_conn = f.result()
            self.ws_conn = ws_conn
            data = {'connection_id': self.connection_id,
                    'nb_code_to_run_async': self.cell_source,}
            msg = json.dumps(data)
            ws_conn.write_message(message=msg)
            white_ns = self._pack_namespace()
            ws_conn.write_message(message=pickle_dumps(white_ns), binary=True)
        except PicklingError as e:
            print(str(e))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号