labrad / pylabrad

python interface for labrad
51 stars 31 forks source link

replace twisted with asyncio #378

Open fanmingyu212 opened 3 years ago

fanmingyu212 commented 3 years ago

Current asynchronous code is handled by twisted, which functionalities can be replaced using asyncio, which is a builtin package after python 3.5. Using asyncio allows users to call other asyncio functions easily in their code with labrad, and enables some of the desired features such as simpler and clearer type annotation (https://github.com/labrad/pylabrad/issues/377).

fanmingyu212 commented 3 years ago

For people who need to use labrad clients and asyncio together: I have made an asyncio wrapper for async connections - See https://github.com/fanmingyu212/labrad-asyncio-interop. It works with pyqt that is based on asyncio and it works with Jupyter notebooks.

This is far from replacing twisted with asyncio in labrad, but it might solve some problem if you need to use asyncio.