strip away the stdout counter (#72)
Remove the counter, the website works now so it's more annoying than useful
This commit is contained in:
commit
438fac10ba
2 changed files with 2 additions and 17 deletions
|
|
@ -6,7 +6,6 @@ pub const WEB_HOST: &str = "127.0.0.1:3000";
|
||||||
pub const IMAGE_SAVE_INTERVAL: Duration = Duration::from_secs(5);
|
pub const IMAGE_SAVE_INTERVAL: Duration = Duration::from_secs(5);
|
||||||
pub const JPEG_UPDATE_INTERVAL: Duration = Duration::from_millis(17);
|
pub const JPEG_UPDATE_INTERVAL: Duration = Duration::from_millis(17);
|
||||||
pub const WEB_UPDATE_INTERVAL: Duration = Duration::from_millis(50);
|
pub const WEB_UPDATE_INTERVAL: Duration = Duration::from_millis(50);
|
||||||
pub const STDOUT_STATISTICS_INTERVAL: Duration = Duration::from_millis(5000);
|
|
||||||
|
|
||||||
pub const HELP_TEXT: &[u8] = b"Flurry is a pixelflut implementation, this means you can use commands to get and set pixels in the canvas
|
pub const HELP_TEXT: &[u8] = b"Flurry is a pixelflut implementation, this means you can use commands to get and set pixels in the canvas
|
||||||
SIZE returns the size of the canvas
|
SIZE returns the size of the canvas
|
||||||
|
|
|
||||||
18
src/main.rs
18
src/main.rs
|
|
@ -8,28 +8,16 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use flurry::{
|
use flurry::{
|
||||||
config::{
|
config::{GRID_LENGTH, HOST, IMAGE_SAVE_INTERVAL, JPEG_UPDATE_INTERVAL},
|
||||||
GRID_LENGTH, HOST, IMAGE_SAVE_INTERVAL, JPEG_UPDATE_INTERVAL, STDOUT_STATISTICS_INTERVAL,
|
|
||||||
},
|
|
||||||
flutclient::{FlutClient, ParserTypes},
|
flutclient::{FlutClient, ParserTypes},
|
||||||
grid::{self, Flut},
|
grid::{self, Flut},
|
||||||
webapi::WebApiContext,
|
webapi::WebApiContext,
|
||||||
AsyncResult, COUNTER,
|
AsyncResult,
|
||||||
};
|
};
|
||||||
use futures::never::Never;
|
use futures::never::Never;
|
||||||
use tokio::{net::TcpListener, time::interval, try_join};
|
use tokio::{net::TcpListener, time::interval, try_join};
|
||||||
use tracing_subscriber::{layer::SubscriberExt as _, util::SubscriberInitExt as _};
|
use tracing_subscriber::{layer::SubscriberExt as _, util::SubscriberInitExt as _};
|
||||||
|
|
||||||
/// This function logs the current amount of changed pixels to stdout every second
|
|
||||||
async fn pixel_change_stdout_log() -> AsyncResult<Never> {
|
|
||||||
let mut interval = tokio::time::interval(STDOUT_STATISTICS_INTERVAL);
|
|
||||||
loop {
|
|
||||||
interval.tick().await;
|
|
||||||
let cnt = COUNTER.load(std::sync::atomic::Ordering::Relaxed);
|
|
||||||
tracing::info!("{cnt} pixels changed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This function starts a timer that saves the current grid state every `duration`.
|
/// This function starts a timer that saves the current grid state every `duration`.
|
||||||
/// These images may then be used for moderation or timelapses
|
/// These images may then be used for moderation or timelapses
|
||||||
///
|
///
|
||||||
|
|
@ -116,7 +104,6 @@ async fn main() {
|
||||||
};
|
};
|
||||||
tracing::info!("Started TCP listener on {HOST}");
|
tracing::info!("Started TCP listener on {HOST}");
|
||||||
|
|
||||||
let pixel_logger = tokio::spawn(pixel_change_stdout_log());
|
|
||||||
let snapshots = tokio::spawn(save_image_frames(grids.clone(), IMAGE_SAVE_INTERVAL));
|
let snapshots = tokio::spawn(save_image_frames(grids.clone(), IMAGE_SAVE_INTERVAL));
|
||||||
let pixelflut_server = tokio::spawn(handle_flut(flut_listener, grids.clone()));
|
let pixelflut_server = tokio::spawn(handle_flut(flut_listener, grids.clone()));
|
||||||
let jpeg_update_loop = tokio::spawn(jpeg_update_loop(grids.clone()));
|
let jpeg_update_loop = tokio::spawn(jpeg_update_loop(grids.clone()));
|
||||||
|
|
@ -125,7 +112,6 @@ async fn main() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
let res = try_join! {
|
let res = try_join! {
|
||||||
pixel_logger,
|
|
||||||
snapshots,
|
snapshots,
|
||||||
pixelflut_server,
|
pixelflut_server,
|
||||||
jpeg_update_loop,
|
jpeg_update_loop,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue