Hi
@Dmitry Lyfar, for stuff like limiting database calls, we have task concurrency limiting in Prefect cloud that work across Flows. I assume you’re not on Cloud though. I am not 100% sure on using the semaphore, but there are two ways to go about this. One is that you can just use the
Resource Manager to write Dask specific code and run it on the cluster. Also this
might be relevant. The second one is by using the Prefect map. I expect the problem here will be that the sempahore might not be serializable, and task inputs and outputs should be. If it is though, it might work with the Prefect map.