Update public backend API surface
Private source commit: ba3f7ce2b6d9
This commit is contained in:
parent
784463622c
commit
26fdcb9d84
34 changed files with 5473 additions and 72 deletions
|
|
@ -3,6 +3,7 @@ use clusterflux_control::endpoint_identity;
|
|||
use clusterflux_control::ControlSession;
|
||||
use clusterflux_core::coordinator_wire_request;
|
||||
use serde_json::Value;
|
||||
use std::time::Duration;
|
||||
|
||||
pub(crate) struct CoordinatorSession {
|
||||
inner: ControlSession,
|
||||
|
|
@ -15,6 +16,16 @@ impl CoordinatorSession {
|
|||
})
|
||||
}
|
||||
|
||||
pub(crate) fn connect_with_timeouts(
|
||||
addr: &str,
|
||||
connect_timeout: Duration,
|
||||
io_timeout: Duration,
|
||||
) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
Ok(Self {
|
||||
inner: ControlSession::connect_with_timeouts(addr, connect_timeout, io_timeout)?,
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn request(&mut self, value: Value) -> Result<Value, Box<dyn std::error::Error>> {
|
||||
let request_id = format!("node-{}", self.inner.requests() + 1);
|
||||
let wire_request = coordinator_wire_request(request_id, value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue