Skip to main content

spawn_function

Function spawn_function 

Source
pub fn spawn_function(name: &str) -> Result<Conn, Error>
Expand description

Spawn a Function

use embly::{Conn, spawn_function};
use embly::prelude::*;
use failure::Error;

fn entrypoint(conn: Conn) -> Result<(), Error> {
    let mut foo = spawn_function("github.com/maxmcd/foo")?;
    foo.write_all("Hello".as_bytes())?;

    // get a response back from  foo
    let mut buffer = Vec::new();
    foo.read_to_end(&mut buffer)?;
    Ok(())
}