New jsonrpc-core with futures and metadata support (#3859)
* Bumping serde & serde_json * Super-initial usage of new jsonrpc * Single event loop for jsonrpc * Metadata * Supporting metadata extraction for eth_accounts * Fixing Cargo.lock * Removing uneccessary clones * Fixing unused import * Unused import * Fixing test
This commit is contained in:
@@ -47,8 +47,10 @@ pub trait Fetch: Clone + Send + Sync + 'static {
|
||||
|
||||
/// Spawn the future in context of this `Fetch` thread pool.
|
||||
/// Implementation is optional.
|
||||
fn process<F>(&self, f: F) -> BoxFuture<(), ()> where
|
||||
F: Future<Item=(), Error=()> + Send + 'static,
|
||||
fn process<F, I, E>(&self, f: F) -> BoxFuture<I, E> where
|
||||
F: Future<Item=I, Error=E> + Send + 'static,
|
||||
I: Send + 'static,
|
||||
E: Send + 'static,
|
||||
{
|
||||
f.boxed()
|
||||
}
|
||||
@@ -99,8 +101,10 @@ impl Fetch for Client {
|
||||
Self::with_limit(Some(50*1024*1024))
|
||||
}
|
||||
|
||||
fn process<F>(&self, f: F) -> BoxFuture<(), ()> where
|
||||
F: Future<Item=(), Error=()> + Send + 'static,
|
||||
fn process<F, I, E>(&self, f: F) -> BoxFuture<I, E> where
|
||||
F: Future<Item=I, Error=E> + Send + 'static,
|
||||
I: Send + 'static,
|
||||
E: Send + 'static,
|
||||
{
|
||||
self.pool.spawn(f).boxed()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user