agner 0.4.1

An actor toolkit inspired by Erlang/OTP
Documentation
#![allow(unused)]

use std::future::Future;
use std::sync::Arc;

use agner_actors::{System, SystemConfig};

pub fn system(max_actors: usize) -> System {
    let exit_handler = Arc::new(agner::actors::exit_handlers::LogExitHandler);

    System::new(SystemConfig { max_actors, exit_handler, ..Default::default() })
}

pub fn run<F>(multi_thread: bool, f: F) -> F::Output
where
    F: Future,
{
    if multi_thread {
        tokio::runtime::Builder::new_multi_thread()
    } else {
        tokio::runtime::Builder::new_current_thread()
    }
    .enable_all()
    .build()
    .expect("Failed to create runtime")
    .block_on(f)
}

fn main() {}