rustasync / runtime

Empowering everyone to build asynchronous software
https://docs.rs/runtime
Apache License 2.0
862 stars 28 forks source link

remove spawn from top-level #47

Closed yoshuawuyts closed 4 years ago

yoshuawuyts commented 5 years ago

This removes the spawn function from the top-level exports

Instead task::spawn should be used. If this were part of std, spawn wouldn't be a top-level method, so we should keep it in task instead.

ghost commented 5 years ago

Looks good to me! One thing I would note is that runtime::task::spawn is little verbose. Perhaps that'd look better if runtime::task was imported first and then we spawned tasks with task::spawn?