script::python::utils

Function block_on_async

source
pub fn block_on_async<T, F>(f: F) -> Result<T>
where F: Future<Output = T> + Send + 'static, T: Send + 'static,
Expand description

Please only use this method because you are calling from (optionally first as async) to sync then to a async a terrible hack to call async from sync by:

TODO(discord9): find a better way

  1. using a cached runtime
  2. block on that runtime