|
@@ -16,9 +16,13 @@
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-use std::time::Duration;
|
|
|
|
|
|
|
+use std::{sync::Arc, time::Duration};
|
|
|
|
|
|
|
|
-use smol::Timer;
|
|
|
|
|
|
|
+use smol::{Executor, Timer};
|
|
|
|
|
+
|
|
|
|
|
+/// Condition variable which allows a task to block until woken up
|
|
|
|
|
+pub mod condvar;
|
|
|
|
|
+pub use condvar::CondVar;
|
|
|
|
|
|
|
|
/// Implementation of async background task spawning which are stoppable
|
|
/// Implementation of async background task spawning which are stoppable
|
|
|
/// using channel signalling.
|
|
/// using channel signalling.
|
|
@@ -33,6 +37,8 @@ pub use subscriber::{Subscriber, SubscriberPtr, Subscription};
|
|
|
pub mod timeout;
|
|
pub mod timeout;
|
|
|
pub use timeout::io_timeout;
|
|
pub use timeout::io_timeout;
|
|
|
|
|
|
|
|
|
|
+pub type ExecutorPtr = Arc<Executor<'static>>;
|
|
|
|
|
+
|
|
|
/// Sleep for any number of seconds.
|
|
/// Sleep for any number of seconds.
|
|
|
pub async fn sleep(seconds: u64) {
|
|
pub async fn sleep(seconds: u64) {
|
|
|
Timer::after(Duration::from_secs(seconds)).await;
|
|
Timer::after(Duration::from_secs(seconds)).await;
|