diff options
| author | Fuwn <[email protected]> | 2021-05-26 23:34:03 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-26 23:34:03 -0700 |
| commit | fca71ccccab25645de00406bd88d6132941f35dc (patch) | |
| tree | 416ad62d129d5a27218fed3d3662b9cda28ac13d /crates/whirl_api/src | |
| parent | docs(crates): clarify that whirl_db is unimplemented (diff) | |
| download | whirl-fca71ccccab25645de00406bd88d6132941f35dc.tar.xz whirl-fca71ccccab25645de00406bd88d6132941f35dc.zip | |
refactor(global): move thread creation to respective crates
Diffstat (limited to 'crates/whirl_api/src')
| -rw-r--r-- | crates/whirl_api/src/lib.rs | 15 |
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; + }) +} |