delouse

Function init

source
pub fn init() -> Result<()>
Expand description

Initialize the delouse internals, and start up a webserver used for pulling debug information from the internals of the resident program.

Note: This MUST be run from inside an async runtime, even though this function is sync, or the call may (should) panic.

Examples found in repository?
examples/heartbeat.rs (line 5)
4
5
6
7
8
9
10
11
12
13
14
15
async fn main() -> Result<()> {
    delouse::init()?;

    let handle = tokio::spawn(async move {
        loop {
            tokio::time::sleep(std::time::Duration::from_secs(1)).await;
            eprintln!("heartbeat");
        }
    });
    handle.await?;
    Ok(())
}