|
@@ -181,6 +181,7 @@ pub struct GatewayClient {
|
|
|
slabstore: Arc<SlabStore>,
|
|
slabstore: Arc<SlabStore>,
|
|
|
gateway_slabs_sub_s: async_channel::Sender<Slab>,
|
|
gateway_slabs_sub_s: async_channel::Sender<Slab>,
|
|
|
gateway_slabs_sub_rv: GatewaySlabsSubscriber,
|
|
gateway_slabs_sub_rv: GatewaySlabsSubscriber,
|
|
|
|
|
+ is_running: bool,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
impl GatewayClient {
|
|
impl GatewayClient {
|
|
@@ -196,13 +197,14 @@ impl GatewayClient {
|
|
|
slabstore,
|
|
slabstore,
|
|
|
gateway_slabs_sub_s,
|
|
gateway_slabs_sub_s,
|
|
|
gateway_slabs_sub_rv,
|
|
gateway_slabs_sub_rv,
|
|
|
|
|
+ is_running: false,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub async fn start(&mut self) -> Result<()> {
|
|
pub async fn start(&mut self) -> Result<()> {
|
|
|
self.protocol.start().await?;
|
|
self.protocol.start().await?;
|
|
|
self.sync().await?;
|
|
self.sync().await?;
|
|
|
-
|
|
|
|
|
|
|
+ self.is_running = true;
|
|
|
Ok(())
|
|
Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -311,6 +313,10 @@ impl GatewayClient {
|
|
|
slabstore.put(slab)?;
|
|
slabstore.put(slab)?;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ pub fn is_running(&self) -> bool {
|
|
|
|
|
+ self.is_running
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fn handle_error(status_code: u32) {
|
|
fn handle_error(status_code: u32) {
|