Expose health status over RPC (#6274)

* Node-health to a separate crate.

* Initialize node_health outside of dapps.

* Expose health over RPC.

* Bring back 412 and fix JS.

* Add health to workspace and tests.

* Fix compilation without default features.

* Fix borked merge.

* Revert to generics to avoid virtual calls.

* Fix node-health tests.

* Add missing trailing comma.
This commit is contained in:
Tomasz Drwięga
2017-08-28 14:11:55 +02:00
committed by Gav Wood
parent 622632616c
commit 3226e1ca33
31 changed files with 513 additions and 300 deletions

View File

@@ -20,7 +20,7 @@
extern crate futures;
extern crate tokio_core;
use std::thread;
use std::{fmt, thread};
use std::sync::mpsc;
use std::time::Duration;
use futures::{Future, IntoFuture};
@@ -81,7 +81,19 @@ enum Mode {
ThreadPerFuture,
}
#[derive(Clone)]
impl fmt::Debug for Mode {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
use self::Mode::*;
match *self {
Tokio(_) => write!(fmt, "tokio"),
Sync => write!(fmt, "synchronous"),
ThreadPerFuture => write!(fmt, "thread per future"),
}
}
}
#[derive(Debug, Clone)]
pub struct Remote {
inner: Mode,
}