Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Time #36

Merged
merged 34 commits into from
Jun 17, 2019
Merged

Time #36

merged 34 commits into from
Jun 17, 2019

Conversation

yoshuawuyts
Copy link
Collaborator

@yoshuawuyts yoshuawuyts commented May 18, 2019

Description

Adds the runtime::time submodule.

use runtime::time::{Delay, Interval};
use std::time::Duration::SECONDS;

#[runtime::main]
async fn main() {
    println!("start");
    Delay::new(6 * SECONDS).await;
    
    #[runtime::for_await]
    for now in Interval::repeat(5 * SECONDS).take(3) {
        println!("5 secs have passed");
    }

    println!("done");
}

Screenshot_2019-05-18 runtime time - Rust

Todos

  • docs
  • remove unwraps
  • tokio implementation
  • finish debug impls
  • finish the ext traits

Motivation and Context

Implements #14. Depends on async-rs/futures-timer#13.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

src/time.rs Outdated Show resolved Hide resolved
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
@yoshuawuyts yoshuawuyts marked this pull request as ready for review June 5, 2019 19:58
@yoshuawuyts
Copy link
Collaborator Author

CI can't install the right nightly version, but this patch should be good for review!

src/time/ext.rs Outdated Show resolved Hide resolved
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
Signed-off-by: Yoshua Wuyts <[email protected]>
@yoshuawuyts yoshuawuyts merged commit 70b10cc into master Jun 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the time branch June 17, 2019 13:17
@yoshuawuyts
Copy link
Collaborator Author

published in [email protected] 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants