fix: fix resource leak (#136)
When a running service is dropped, its connections should be closed and its resources should be cleaned up. This changes the default from leaving services running to closing them. Library users who want their services to remain running should call `waiting` on their running service, in a new task where necessary. Co-authored-by: Paul Ellenbogen <pe5@cs.princeton.edu>
This commit is contained in:
parent
5e4d447b32
commit
b1542a6153
1 changed files with 8 additions and 7 deletions
|
|
@ -13,6 +13,6 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||
|
||||
let io = (tokio::io::stdin(), tokio::io::stdout());
|
||||
|
||||
serve_server(generic_service, io).await?;
|
||||
serve_server(generic_service, io).await?.waiting().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue