Make room for tokio 0.2
This commit is contained in:
parent
f9049d6ee4
commit
b876fb84ba
|
@ -70,10 +70,9 @@ solana-vote-signer = { path = "../vote-signer", version = "1.4.0" }
|
||||||
spl-token-v1-0 = { package = "spl-token", version = "1.0.6", features = ["skip-no-mangle"] }
|
spl-token-v1-0 = { package = "spl-token", version = "1.0.6", features = ["skip-no-mangle"] }
|
||||||
tempfile = "3.1.0"
|
tempfile = "3.1.0"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
tokio = "0.1"
|
tokio_01 = { version = "0.1", package = "tokio" }
|
||||||
tokio-codec = "0.1"
|
tokio_fs_01 = { version = "0.1", package = "tokio-fs" }
|
||||||
tokio-fs = "0.1"
|
tokio_io_01 = { version = "0.1", package = "tokio-io" }
|
||||||
tokio-io = "0.1"
|
|
||||||
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.0" }
|
solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "1.4.0" }
|
||||||
trees = "0.2.1"
|
trees = "0.2.1"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ use std::{
|
||||||
sync::{mpsc::channel, Arc, RwLock},
|
sync::{mpsc::channel, Arc, RwLock},
|
||||||
thread::{self, Builder, JoinHandle},
|
thread::{self, Builder, JoinHandle},
|
||||||
};
|
};
|
||||||
use tokio::prelude::Future;
|
|
||||||
|
|
||||||
pub struct JsonRpcService {
|
pub struct JsonRpcService {
|
||||||
thread_hdl: JoinHandle<()>,
|
thread_hdl: JoinHandle<()>,
|
||||||
|
@ -97,6 +96,9 @@ impl RpcRequestMiddleware {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_file_get(&self, path: &str) -> RequestMiddlewareAction {
|
fn process_file_get(&self, path: &str) -> RequestMiddlewareAction {
|
||||||
|
// Stuck on tokio 0.1 until the jsonrpc-http-server crate upgrades to tokio 0.2
|
||||||
|
use tokio_01::prelude::*;
|
||||||
|
|
||||||
let stem = path.split_at(1).1; // Drop leading '/' from path
|
let stem = path.split_at(1).1; // Drop leading '/' from path
|
||||||
let filename = {
|
let filename = {
|
||||||
match path {
|
match path {
|
||||||
|
@ -115,10 +117,10 @@ impl RpcRequestMiddleware {
|
||||||
RequestMiddlewareAction::Respond {
|
RequestMiddlewareAction::Respond {
|
||||||
should_validate_hosts: true,
|
should_validate_hosts: true,
|
||||||
response: Box::new(
|
response: Box::new(
|
||||||
tokio_fs::file::File::open(filename)
|
tokio_fs_01::file::File::open(filename)
|
||||||
.and_then(|file| {
|
.and_then(|file| {
|
||||||
let buf: Vec<u8> = Vec::new();
|
let buf: Vec<u8> = Vec::new();
|
||||||
tokio_io::io::read_to_end(file, buf)
|
tokio_io_01::io::read_to_end(file, buf)
|
||||||
.and_then(|item| Ok(hyper::Response::new(item.1.into())))
|
.and_then(|item| Ok(hyper::Response::new(item.1.into())))
|
||||||
.or_else(|_| Ok(RpcRequestMiddleware::internal_server_error()))
|
.or_else(|_| Ok(RpcRequestMiddleware::internal_server_error()))
|
||||||
})
|
})
|
||||||
|
|
|
@ -38,7 +38,9 @@ use std::{
|
||||||
iter,
|
iter,
|
||||||
sync::{Arc, Mutex, RwLock},
|
sync::{Arc, Mutex, RwLock},
|
||||||
};
|
};
|
||||||
use tokio::runtime::{Builder as RuntimeBuilder, Runtime, TaskExecutor};
|
|
||||||
|
// Stuck on tokio 0.1 until the jsonrpc-pubsub crate upgrades to tokio 0.2
|
||||||
|
use tokio_01::runtime::{Builder as RuntimeBuilder, Runtime, TaskExecutor};
|
||||||
|
|
||||||
const RECEIVE_DELAY_MILLIS: u64 = 100;
|
const RECEIVE_DELAY_MILLIS: u64 = 100;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue