whynot 0.1.1

Rust ↔ PHP bridge: call PHP functions from Rust, capture return values, output, and exceptions.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use whynot::{new_runtime, RuntimeConfig, RuntimeKind};
use whynot::process::ProcRuntime;

fn main() {
    let cfg = RuntimeConfig { debug: false, ..Default::default() };
    let _rt = new_runtime(RuntimeKind::Process(cfg.clone())).unwrap();

    let h1 = ProcRuntime::call_async_with_cfg(cfg.clone(), "greet".to_string(), vec!["Milton".into()]);
    let h2 = ProcRuntime::call_async_with_cfg(cfg.clone(), "add".to_string(), vec![7.into(), 9.into()]);

    let r1 = h1.join().unwrap().unwrap();
    let r2 = h2.join().unwrap().unwrap();

    println!("greet: {:?}", r1.result);
    println!("add: {:?}", r2.result);
}