Struct grb::AsyncHandle [−][src]
pub struct AsyncHandle(_);
Expand description
A handle to an AsyncModel
which is currently solving.
Implementations
Retrieve the current attr::BarIterCount
of the model.
Wait for optimisation to finish.
Errors
An Error::FromAPI
may occur during optimisation, in which case it is stored in the Result
.
Send a request to Gurobi to terminate optimization. Optimization may not finish immediately.
Example
use grb::AsyncModel;
let e = Env::new("")?;
let m = Model::with_env("async", e)?;
...
let m = AsyncModel::new(m);
// discard `AsyncModel` on failure and panic
let handle = m.optimize().map_err(|(_, e)| e).unwrap();
...
handle.terminate();