Skip to content

Commit

Permalink
feat(code/example): Simulate processing time in example app
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Feb 20, 2025
1 parent d8e8e28 commit f390e0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/examples/channel/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
//! A regular application would have mempool implemented, a proper database and input methods like RPC.
use std::collections::{HashMap, HashSet};
use std::time::Duration;

use bytes::{Bytes, BytesMut};
use eyre::eyre;
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
use sha3::Digest;
use tokio::time::sleep;
use tracing::{debug, error};

use malachitebft_app_channel::app::consensus::ProposedValue;
Expand Down Expand Up @@ -244,6 +246,9 @@ impl State {
// We create a new value.
let value = self.make_value(height, round);

// Simulate some processing time
sleep(Duration::from_millis(500)).await;

let proposal = ProposedValue {
height,
round,
Expand Down

0 comments on commit f390e0d

Please sign in to comment.