prints running coroutines

This commit is contained in:
Y. T. Chung
2015-10-03 13:47:42 +08:00
parent 66ee37d308
commit 315b288014
2 changed files with 18 additions and 0 deletions

View File

@@ -177,6 +177,15 @@ fn main() {
.ok().expect("`threads` should be an integer");
Scheduler::new().with_workers(threads).run(move|| {
if matches.occurrences_of("VERBOSE") >= 1 {
Scheduler::spawn(move|| {
loop {
coio::sleep_ms(1000);
debug!("Running coroutines: {}", Scheduler::instance().work_count());
}
});
}
RelayLocal::new(config).run();
}).unwrap();
}

View File

@@ -171,6 +171,15 @@ fn main() {
.ok().expect("`threads` should be an integer");
Scheduler::new().with_workers(threads).run(move|| {
if matches.occurrences_of("VERBOSE") >= 1 {
Scheduler::spawn(move|| {
loop {
coio::sleep_ms(1000);
debug!("Running coroutines: {}", Scheduler::instance().work_count());
}
});
}
RelayServer::new(config).run();
}).unwrap();
}