Closed sheldonth closed 2 years ago
Yes I'm hitting exactly the same problem.
+1, I also encountering the same problem.
Hi @sheldonth, @sp1ff, @annder Thanks for the bug reports.
So - root cause. The future you're trying to await on can't be sent between threads (there's no Sync trait implemented on the value). This is to do with the API you're trying to put inside of the async parts. That is unfortunately out of the scope of this crate. It was encountered with other people earlier https://github.com/mvniekerk/tokio-cron-scheduler/issues/8 so have look. Basically - their suggestion is to have an MPSC Sender that's moved to the scheduler job, and a receiver that runs in current thread / another thread that waits for values from the MSPC.
Give an async function called
task
the following code seems like it should work:Yet I see the error
Can't seem to find the error in my ways here. Appreciate any help.