/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
usecrate::authenticatorservice::AuthenticatorTransport; usecrate::authenticatorservice::{RegisterArgs, SignArgs}; usecrate::errors::*; usecrate::statecallback::StateCallback; usecrate::statemachine::StateMachine; usecrate::Pin; use runloop::RunLoop; use std::io; use std::sync::mpsc::{channel, RecvTimeoutError, Sender}; use std::time::Duration;
// Start a new work queue thread. let queue = RunLoop::new(move |alive| { letmut sm = StateMachine::new();
while alive() { match rx.recv_timeout(Duration::from_millis(50)) {
Ok(QueueAction::Register {
timeout,
register_args,
status,
callback,
}) => { // This must not block, otherwise we can't cancel.
sm.register(timeout, register_args, status, callback);
}
Ok(QueueAction::Sign {
timeout,
sign_args,
status,
callback,
}) => { // This must not block, otherwise we can't cancel.
sm.sign(timeout, sign_args, status, callback);
}
Ok(QueueAction::Cancel) => { // Cancelling must block so that we don't start a new // polling thread before the old one has shut down.
sm.cancel();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.