Skip to content

Commit

Permalink
0.19.0 with futures-timer
Browse files Browse the repository at this point in the history
  • Loading branch information
clux committed Nov 15, 2019
1 parent da326f6 commit d3c0d6e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
0.19.0 / 2019-XX-XX
0.19.0 / 2019-11-15
==================
* kube::Error is now a proper error enum and not a Fail impl (thiserror)
* soft-tokio dependency removed for futures-timer
* gzip re-introduced

0.18.1 / 2019-11-11
==================
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kube"
version = "0.18.1"
version = "0.19.0"
description = "Kubernetes client in the style of client-go"
authors = [
"clux <sszynrae@gmail.com>",
Expand All @@ -27,8 +27,8 @@ url = "2.1.0"
log = "0.4.8"
time = "0.1.42"
either = "1.5.3"
tokio = { version = "=0.2.0-alpha.6", default-features = false, features = ["timer"] }
thiserror = "1.0.5"
futures-timer = "2.0.0"

[features]
default = []
Expand Down
5 changes: 3 additions & 2 deletions src/api/informer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::client::APIClient;
use crate::{Result};

use serde::de::DeserializeOwned;
use futures_timer::Delay;
use std::{
collections::VecDeque,
sync::{Arc, RwLock},
Expand Down Expand Up @@ -143,8 +144,8 @@ impl<K> Informer<K> where
Err(e) => {
warn!("Poll error: {:?}", e);
// If desynched due to mismatching resourceVersion, retry in a bit
let when = tokio::clock::now() + Duration::from_secs(10);
tokio::timer::delay(when).await;
let dur = Duration::from_secs(10);
Delay::new(dur).await;
self.reset().await?;
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/api/reflector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::api::resource::{
KubeObject,
};
use serde::de::DeserializeOwned;

use futures_timer::Delay;
use crate::client::APIClient;
use crate::{Result, Error};

Expand Down Expand Up @@ -123,8 +123,8 @@ impl<K> Reflector<K> where
trace!("Watching {:?}", self.resource);
if let Err(_e) = self.single_watch().await {
// If desynched due to mismatching resourceVersion, retry in a bit
let when = tokio::clock::now() + Duration::from_secs(10);
tokio::timer::delay(when).await;
let dur = Duration::from_secs(10);
Delay::new(dur).await;
self.reset().await?; // propagate error if this failed..
}

Expand Down

0 comments on commit d3c0d6e

Please sign in to comment.