queue culling and informant

This commit is contained in:
Robert Habermeier
2017-03-23 22:20:00 +01:00
parent 3708b3be63
commit a78068cbe9
7 changed files with 154 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ impl fmt::Display for Error {
/// Light client service.
pub struct Service {
client: Arc<Client>,
_io_service: IoService<ClientIoMessage>,
io_service: IoService<ClientIoMessage>,
}
impl Service {
@@ -82,10 +82,15 @@ impl Service {
io_service.register_handler(Arc::new(ImportBlocks(client.clone()))).map_err(Error::Io)?;
Ok(Service {
client: client,
_io_service: io_service,
io_service: io_service,
})
}
/// Register an I/O handler on the service.
pub fn register_handler(&self, handler: Arc<IoHandler<ClientIoMessage> + Send>) -> Result<(), IoError> {
self.io_service.register_handler(handler)
}
/// Get a handle to the client.
pub fn client(&self) -> &Arc<Client> {
&self.client