Set dask as default executor for param?

I just learned that param supports async execution like in the example below:

import param, asyncio, aiohttp
from tornado.ioloop import IOLoop

param.parameterized.async_executor = IOLoop.current().add_callback

class Downloader(param.Parameterized):
    url = param.String()
    results = param.List()
    def __init__(self, **params):
        super().__init__(**params), ['url'])

    async def fetch(self, event):
        async with aiohttp.ClientSession() as session:
            async with session.get( as response:
                img = await
                self.results.append((, img))

f = Downloader()
n = 7
for index in range(n):
    f.url = f"{index}"

f.results # will update gradually

Is there a way to set dask (in async mode or with futures) as the default executor?


I love this async example.

1 Like