Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lsf.rs #21

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crankshaft/examples/lsf.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! An example for runner a task using the Docker backend service.
//! An example for runner a task using the generic LSF backend service.

use crankshaft::engine::task::Execution;
use crankshaft::engine::Engine;
Expand Down Expand Up @@ -45,7 +45,7 @@ async fn main() {
.try_build()
.unwrap();

let receivers = (0..10)
let receivers = (0..1000)
.map(|_| engine.submit(task.clone()).callback)
.collect::<Vec<_>>();

Expand Down
4 changes: 4 additions & 0 deletions crankshaft/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pub mod config;
pub mod service;
pub mod task;

use std::time::Duration;

use futures::StreamExt;
use indicatif::ProgressBar;
use indicatif::ProgressStyle;
Expand Down Expand Up @@ -60,6 +62,8 @@ impl Engine {
);

let mut count = 1;
task_completion_bar.inc(0);
task_completion_bar.enable_steady_tick(Duration::from_millis(100));

while let Some(()) = self.runner.tasks.next().await {
task_completion_bar.set_message(format!("task #{}", count));
Expand Down
Loading