简体   繁体   English

如何从单独的线程中的dask.distributed运行进度条小部件?

[英]How to run progress bar widget from dask.distributed in a separate thread?

There is an example here , showing insertion of data for processing in a separate thread. 有一个例子在这里 ,示出在单独的线程中处理数据的插入。 I'm interested in reverse, when data are inserted manually and interactively, and background thread submits them to cluster for calculation. 我对反向感兴趣,当手动和交互式插入数据时,后台线程将它们提交到集群进行计算。

This is already the case. 情况已经如此。 When you call 你打电话时

client.submit(function, *args, **kwargs)

This serializes stuff immediately in the local thread (blocking), but then adds a callback to the Tornado IOLoop (running in a separate thread) to manage the actual communication to the scheduler. 这会在本地线程中立即序列化内容(阻塞),但随后会向Tornado IOLoop(在单独的线程中运行)添加回调以管理与调度程序的实际通信。 This all happens asynchronously to the main thread. 这一切都与主线程异步发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM