dask-benchmarks icon indicating copy to clipboard operation
dask-benchmarks copied to clipboard

How to support asynchronous functions?

Open mrocklin opened this issue 6 years ago • 1 comments

Much of the distributed codebase should probably be tested with async def functions. Does anyone have experience here? A quick web search doesn't list much.

mrocklin avatar Dec 16 '19 20:12 mrocklin

I think Antoine's setup in https://github.com/dask/dask-benchmarks/blob/master/distributed/benchmarks/comm.py#L16 may work. The function to be timed is a normal callable

    def time_tcp_connect(self):
        self._time_connect('tcp://127.0.0.1')

which calls a callable that calls run_sync

    def _time_connect(self, address):
        run_sync(self.loop, partial(self._main, address))

TomAugspurger avatar Dec 16 '19 21:12 TomAugspurger