aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_api/src/lib.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-26 23:34:03 +0000
committerFuwn <[email protected]>2021-05-26 23:34:03 +0000
commitc4df3731e3f3e28f7129930f83b34f4a4aadf614 (patch)
tree02e4b42e05347f76ecf55a0025649a745385b7c8 /crates/whirl_api/src/lib.rs
parentdocs(crates): clarify that whirl_db is unimplemented (diff)
downloadwhirl-c4df3731e3f3e28f7129930f83b34f4a4aadf614.tar.xz
whirl-c4df3731e3f3e28f7129930f83b34f4a4aadf614.zip
refactor(global): move thread creation to respective crates
Diffstat (limited to 'crates/whirl_api/src/lib.rs')
-rw-r--r--crates/whirl_api/src/lib.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/whirl_api/src/lib.rs b/crates/whirl_api/src/lib.rs
index 3ab6cd8..d2f7811 100644
--- a/crates/whirl_api/src/lib.rs
+++ b/crates/whirl_api/src/lib.rs
@@ -47,3 +47,18 @@ impl Api {
sys.block_on(server)
}
}
+
+pub fn make() -> tokio::task::JoinHandle<()> {
+ // actix_web::rt::System::new("").block_on(rx.recv().unwrap().stop(true));
+
+ tokio::spawn(async move {
+ let _ = crate::Api::listen(
+ std::sync::mpsc::channel().0,
+ &*format!(
+ "0.0.0.0:{}",
+ whirl_config::Config::get().whirlsplash.api.port
+ ),
+ )
+ .await;
+ })
+}