This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.datastax.driver.core.exceptions.NoHostAvailableException; | |
import io.lettuce.core.RedisCommandExecutionException; | |
import org.slf4j.Logger; | |
import java.util.concurrent.Callable; | |
public class ExponentialBackoff { | |
private final long delay; | |
private final long maxAttempts; | |
private final Logger logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.datastax.oss.driver.api.core.CqlSession; | |
import com.datastax.oss.driver.api.core.config.DefaultDriverOption; | |
import com.datastax.oss.driver.api.core.config.DriverConfigLoader; | |
import com.datastax.oss.driver.api.core.cql.PreparedStatement; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.TimeUnit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xc58efd154ce32f6d, | |
0xfcbd65e54bf53ed9, | |
0xea3742c76bf95d47, | |
0xfb9e125878fa6cb3, | |
0x1ebd294ba7fe8b31, | |
0xf29ba87dc5f1a98d, | |
0x815a7e4ed4e3b7f9, | |
0x63acbfe213f5d867, | |
0x67e2d1b542f9e6d3, | |
0x682ec13872ecf651, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///Describes Executor configuration | |
pub trait ExecutorConfig { | |
///Function to call when exectur goes to sleep. | |
fn on_sleep(&mut self) { | |
#[cfg(not(feature = "std"))] | |
core::sync::atomic::spin_loop_hint(); | |
#[cfg(feature = "std")] | |
std::thread::yield_now(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: internal compiler error: src\librustc_mir\transform\generator.rs:532: Broken MIR: generator contains type std::option::Option<http::header::HeaderValue> in MIR, but typeck only knows about for<'r> {&'r client::Client<C>, client::request::Request, usize, http::Method, http::Uri, http::HeaderMap, std::option::Option<bytes::Bytes>, hyper::client::ResponseFuture, futures_util::future::map::Map<futures_util::compat::compat01as03::Compat01As03<hyper::client::ResponseFuture>, [closure@src\client\mod.rs:233:80: 233:131]>, fn(std::result::Result<client::response::Response, hyper::Error>) -> std::result::Result<<std::result::Result<client::response::Response, hyper::Error> as std::ops::Try>::Ok, <std::result::Result<client::response::Response, hyper::Error> as std::ops::Try>::Error> {<std::result::Result<client::response::Response, hyper::Error> as std::ops::Try>::into_result}, ()} | |
--> src\client\mod.rs:217:86 | |
| | |
217 | pub async fn redirect_request(&self, mut req: request::Request) -> RequestResult { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Personal GitHub account | |
Host github.com | |
HostName github.com | |
User git | |
AddKeysToAgent yes | |
IdentityFile ~/.ssh/id_rsa | |
# Work GitHub account | |
Host github.com-work | |
HostName github.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error[E0282]: type annotations needed | |
--> src\multi.rs:158:5 | |
| | |
158 | / fn spawn(self) where Self: 'static + Future<Item=(), Error=()> + Send { | |
159 | | spawn(self); | |
160 | | } | |
| |_____^ cannot infer type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<F: Send + 'static + Future<Item=I, Error=E>, I: Send + 'static, E: Send + 'static> AutoRuntime for F { | |
#[inline] | |
fn finish(self) -> Result<Self::Item, Self::Error> { | |
block_on(self) | |
} | |
#[inline] | |
fn spawn(self) where Self: 'static + Future<Item=(), Error=()> + Send { | |
spawn(self); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///Trait to bootstrap your futures. | |
pub trait AutoRuntime: futures::Future { | |
///Runs futures to completion. | |
/// | |
///## Note | |
/// | |
///It must not be used from within async context | |
#[cfg(not(feature = "multi"))] | |
fn finish(self) -> Result<Self::Item, Self::Error>; | |
#[cfg(feature = "multi")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait UnaryPredicate<T> { | |
#[doc(hidden)] | |
fn call(&self, val: &T) -> bool; | |
} | |
impl<T: PartialEq> UnaryPredicate<T> for T { | |
#[inline(always)] | |
fn call(&self, val: &T) -> bool { | |
self == val | |
} |