We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 420ca23 commit 6c1b931Copy full SHA for 6c1b931
src/wrapper.rs
@@ -246,15 +246,19 @@ struct PySampler(SamplerState);
246
fn make_callback(callback: Option<Py<PyAny>>) -> Option<ProgressCallback> {
247
match callback {
248
Some(callback) => {
249
- Some(Box::new(move |stats: Box<[ChainProgress]>| {
+ let callback = Box::new(move |stats: Box<[ChainProgress]>| {
250
let _ = Python::with_gil(|py| {
251
let args = PyList::new_bound(
252
py,
253
stats.into_vec().into_iter().map(|prog| PyChainProgress(prog).into_py(py))
254
);
255
callback.call1(py, (args,))
256
});
257
- }))
+ });
258
+ Some(ProgressCallback {
259
+ callback,
260
+ rate: Duration::from_millis(500),
261
+ })
262
},
263
None => { None },
264
}
0 commit comments