This repository has been archived by the owner on Nov 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit - support for multiple instances of the same capability provider to be loaded and disambiguated via named bindings * Adding the multi-binding example * Refactoring out 'option proliferation' and adding back support for manifest application * Make tests pass * More updates and samples * Updating rustdoc on from_instance function * minor fix for consistency * Adding manifest sample * Enabling all features for the CI build
- Loading branch information
1 parent
8f67f65
commit 690d76a
Showing
48 changed files
with
1,303 additions
and
856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "wascc-host" | ||
version = "0.5.3" | ||
version = "0.6.0" | ||
authors = ["Kevin Hoffman <[email protected]>"] | ||
edition = "2018" | ||
homepage = "https://wascc.dev" | ||
|
@@ -15,16 +15,15 @@ exclude = ["examples/.assets"] | |
|
||
[badges] | ||
maintenance = { status = "actively-developed" } | ||
travis-ci = { repository = "wascc/wascc-host", branch = "master" } | ||
|
||
[dependencies] | ||
libloading = "0.5.2" | ||
crossbeam-channel = "0.4.2" | ||
crossbeam = "0.7.3" | ||
crossbeam-utils = "^0.7.0" | ||
wapc = "0.4.2" | ||
wascc-codec = "0.5.0" | ||
wascap = "0.4.4" | ||
wapc = "0.5.0" | ||
wascc-codec = "0.6.0" | ||
wascap = "0.4.5" | ||
log = "0.4.8" | ||
lazy_static = "1.4.0" | ||
rand = "0.7.3" | ||
|
@@ -39,7 +38,7 @@ serde_yaml = { version = "0.8.11", optional = true } | |
serde_json = { version = "1.0", optional = true } | ||
envmnt = { version = "0.8.1", optional = true } | ||
|
||
structopt = { version = "0.3.11", optional = true } | ||
structopt = { version = "0.3.12", optional = true } | ||
|
||
[features] | ||
default = [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use std::collections::HashMap; | ||
use wascc_host::{Actor, NativeCapability, WasccHost}; | ||
|
||
fn main() -> std::result::Result<(), Box<dyn std::error::Error>> { | ||
env_logger::init(); | ||
let host = WasccHost::new(); | ||
host.add_actor(Actor::from_file("./examples/.assets/as-actor.wasm")?)?; | ||
host.add_native_capability(NativeCapability::from_file( | ||
"./examples/.assets/libwascc_httpsrv.so", | ||
None, | ||
)?)?; | ||
host.add_native_capability(NativeCapability::from_file( | ||
"./examples/.assets/libredis_provider.so", | ||
None, | ||
)?)?; | ||
|
||
host.bind_actor( | ||
"MB4OLDIC3TCZ4Q4TGGOVAZC43VXFE2JQVRAXQMQFXUCREOOFEKOKZTY2", | ||
"wascc:http_server", | ||
None, | ||
generate_port_config(8081), | ||
)?; | ||
|
||
host.bind_actor( | ||
"MB4OLDIC3TCZ4Q4TGGOVAZC43VXFE2JQVRAXQMQFXUCREOOFEKOKZTY2", | ||
"wascc:keyvalue", | ||
None, | ||
redis_config(), | ||
)?; | ||
|
||
std::thread::park(); | ||
|
||
Ok(()) | ||
} | ||
|
||
fn generate_port_config(port: u16) -> HashMap<String, String> { | ||
let mut hm = HashMap::new(); | ||
hm.insert("PORT".to_string(), port.to_string()); | ||
|
||
hm | ||
} | ||
|
||
fn redis_config() -> HashMap<String, String> { | ||
let mut hm = HashMap::new(); | ||
hm.insert("URL".to_string(), "redis://127.0.0.1:6379".to_string()); | ||
|
||
hm | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// An example demonstrating loading a manifest | ||
// For this to run, you'll need both the `manifest` and `gantry` | ||
// features enabled, you can do that as follows from the root wascc-host directory: | ||
// cargo run --example kvcounter_manfifest --all-features | ||
|
||
use wascc_host::{WasccHost, HostManifest}; | ||
|
||
fn main() -> std::result::Result<(), Box<dyn std::error::Error>> { | ||
env_logger::init(); | ||
let host = WasccHost::new(); | ||
host.apply_manifest(HostManifest::from_yaml("./examples/sample_manifest.yaml", false)?)?; | ||
|
||
std::thread::park(); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use std::collections::HashMap; | ||
use wascc_host::{Actor, NativeCapability, WasccHost}; | ||
|
||
fn main() -> std::result::Result<(), Box<dyn std::error::Error>> { | ||
env_logger::init(); | ||
let host = WasccHost::new(); | ||
host.add_actor(Actor::from_file("./examples/.assets/logger.wasm")?)?; | ||
host.add_native_capability(NativeCapability::from_file( | ||
"./examples/.assets/libwascc_httpsrv.so", | ||
None, | ||
)?)?; | ||
host.add_native_capability(NativeCapability::from_file( | ||
"./examples/.assets/libwascc_log.so", | ||
None, | ||
)?)?; | ||
|
||
host.bind_actor( | ||
"MDW7BWQDVYBRC6WKSJRRZL27R73EVBWQINYLPFDRCWDZDFQO4JMO4U6J", | ||
"wascc:http_server", | ||
None, | ||
generate_port_config(8081), | ||
)?; | ||
|
||
std::thread::park(); | ||
|
||
Ok(()) | ||
} | ||
|
||
fn generate_port_config(port: u16) -> HashMap<String, String> { | ||
let mut hm = HashMap::new(); | ||
hm.insert("PORT".to_string(), port.to_string()); | ||
|
||
hm | ||
} |
Oops, something went wrong.