Closed gy0801151351 closed 2 years ago
Hi @gy0801151351 Thank you for the bug report. I've added an example (https://github.com/mvniekerk/tokio-cron-scheduler/blob/main/examples/simple_job_tokio_in_a_thread.rs).
The issue is new_current_thread() vs new_multi_thread(). I don't have a solution for you in the library apart from advising you to use new_multi_thread() when creating the tokio context.
Noted! But it works fine with version 0.5.x. This issue is found when I use version 0.6.x or 0.7.x. For some situations, we need run some tasks within local future, where objects with "!Send" are used. So, I wish your crate supporting "new_current_thread() ". Thanks!
version: 0.7.4 os: windows11 rustc: 1.61.0 cargo: 1.61.0