feat(app): add stdin-managed targets and per-target HMAC #136
No files matched your search
@@ -250,15 +250,11 @@ fn dynamic_update_reaches_background_worker() {
|
||||
.unwrap();
|
||||
let handle = owner.handle();
|
||||
|
||||
let acknowledgement = test_runtime().block_on(async {
|
||||
timeout(
|
||||
Duration::from_secs(2),
|
||||
handle.update_targets(vec![target(&server)]).unwrap(),
|
||||
)
|
||||
.await
|
||||
let acknowledgement = handle
|
||||
.update_targets(vec![target(&server)])
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
});
|
||||
.blocking_wait()
|
||||
.unwrap();
|
||||
assert_eq!(acknowledgement.sequence, 1);
|
||||
server.wait_probe();
|
||||
test_runtime().block_on(async {
|
||||
|
||||
@@ -301,6 +301,19 @@ pub struct ManagedCommandReceipt {
|
||||
receiver: oneshot::Receiver<Result<ManagedCommandAcknowledgement, ManagedCommandApplyError>>,
|
||||
}
|
||||
|
||||
impl ManagedCommandReceipt {
|
||||
/// Block until the target-set transaction is applied or rejected.
|
||||
///
|
||||
/// This is for synchronous callers such as [`BlockingManagedClient`]. It
|
||||
/// must not be called from an asynchronous runtime; use the [`Future`]
|
||||
/// implementation there instead.
|
||||
pub fn blocking_wait(self) -> Result<ManagedCommandAcknowledgement, ManagedCommandApplyError> {
|
||||
self.receiver
|
||||
.blocking_recv()
|
||||
.unwrap_or(Err(ManagedCommandApplyError::AcknowledgementDisconnected))
|
||||
}
|
||||
}
|
||||
|
||||
impl Future for ManagedCommandReceipt {
|
||||
type Output = Result<ManagedCommandAcknowledgement, ManagedCommandApplyError>;
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
|
||||
Reference in new issue
Block a user