Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

client/daemon: graceful shutdown

+7 -3
+7 -3
client/src/sower/daemon.rs
··· 4 4 use std::time::Duration; 5 5 6 6 use phoenix_channels_client::url::Url; 7 - use serde_json::json; 8 - use tracing::info; 9 - 10 7 use phoenix_channels_client::{ 11 8 Channel, Event, EventPayload, EventsError, Payload, Socket, Topic, JSON, 12 9 }; 10 + use serde_json::json; 11 + use tokio::signal; 12 + use tracing::info; 13 13 14 14 pub struct Daemon { 15 15 tree: Tree, ··· 71 71 72 72 let events = self.lobby_channel.events(); 73 73 tokio::select! { 74 + _ = signal::ctrl_c() => { 75 + info!("Received shutdown") 76 + }, 77 + 74 78 _ = async { 75 79 info!("Listening for events"); 76 80 loop {