sleepless demo to complement sleepless nights

18 ktps on macbook pro, no gpu
This commit is contained in:
Greg Fitzgerald
2018-04-26 13:17:36 -06:00
parent 9ed953e8c3
commit d415b17146
6 changed files with 30 additions and 15 deletions

View File

@ -131,6 +131,17 @@ impl AccountantStub {
/// Return the number of transactions the server processed since creating
/// this stub instance.
pub fn transaction_count(&mut self) -> u64 {
// Wait for at least one EntryInfo.
let mut done = false;
while !done {
let resp = self.recv_response().expect("recv response");
if let &Response::EntryInfo(_) = &resp {
done = true;
}
self.process_response(resp);
}
// Then take the rest.
self.socket.set_nonblocking(true).expect("set nonblocking");
loop {
match self.recv_response() {