Hi,
I have a futures::mpsc::unbounded that receives futures, I want to create a future that receives from the channel and executes the futures with a delay in between, and pass that future to a tokio core.run(fut);
Tried receiver.for_each and works but it returns when there are no more items in the stream, I need it to just wait in there till a new item is received.
I am basically looking for a waiting/blocking version of for_each that I can pass to a tokio_core.
This is what i have:
let dequeuer = self.dequeuer.take().unwrap();
thread::spawn(||{
let mut core = Core::new().unwrap();
let handle = core.handle();
let done = dequeuer.for_each(|msg| {
handle.spawn(msg);
Ok(())
});
core.run(done).unwrap();
println!("Returned!");
});