After the specified delay, submits a closure for asynchronous execution on self.
(&self, delay: Duration, work: F)
| 164 | /// After the specified delay, submits a closure for asynchronous execution |
| 165 | /// on self. |
| 166 | pub fn exec_after<F>(&self, delay: Duration, work: F) |
| 167 | where F: 'static + Send + FnOnce() { |
| 168 | let when = time_after_delay(delay); |
| 169 | let (context, work) = context_and_function(work); |
| 170 | unsafe { |
| 171 | dispatch_after_f(when, self.ptr, context, work); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | /// Submits a closure to be executed on self the given number of iterations |
| 176 | /// and waits until it completes. |