forked from StrafesNET/strafe-client
enable compat_worker interop with real workers
This commit is contained in:
parent
8fc6a7fb8f
commit
7ba94c1b30
@ -3,11 +3,11 @@ pub type INWorker<'a,Task>=CompatNWorker<'a,Task>;
|
||||
|
||||
pub struct CompatNWorker<'a,Task>{
|
||||
data:std::marker::PhantomData<Task>,
|
||||
f:Box<dyn FnMut(Task)+'a>,
|
||||
f:Box<dyn FnMut(Task)+Send+'a>,
|
||||
}
|
||||
|
||||
impl<'a,Task> CompatNWorker<'a,Task>{
|
||||
pub fn new(f:impl FnMut(Task)+'a)->CompatNWorker<'a,Task>{
|
||||
pub fn new(f:impl FnMut(Task)+Send+'a)->CompatNWorker<'a,Task>{
|
||||
Self{
|
||||
data:std::marker::PhantomData,
|
||||
f:Box::new(f),
|
||||
|
Loading…
Reference in New Issue
Block a user