[−][src]Function async_runtime::init
pub fn init(config: Config) -> Result<(), Error>
Set the executor to use by on this thread. Run this before calls to spawn
(_*).
If you are a library author, don't call this unless you create the thread, otherwise it's up to client code to
decide which executor to use. Just call spawn
.
Errors
This method will fail with ErrorKind::DoubleExecutorInit
if you call it twice on the same thread. There is
init_allow_same
which will not return an error if you try to init with the same executor twice.