Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/piper"]
path = lib/piper
url = git@github.com:katharostech/piper.git
43 changes: 31 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,24 @@ exclude = [

[features]
default = ["actor-pool"]

# Actor System Features

# Enable the use of AidPool's
actor-pool = ["rand", "rand_xoshiro"]

# Automatically determine the default number of threads from the number of CPUs. Adds the
# num_cpus dependency.
auto-num-threads = ["num_cpus"]

# Logging features

# Disables trace logging for release builds ( may improve performance for release builds )
no-release-trace-logging = ["tracing/release_max_level_trace"]

# Enables logging messages created by the `log` crate as well as the `tracing` crate
enable-log-crate = ["tracing/log"]

[badges]
# We won't be using Travis in a bit
#travis-ci = { repository = "katharostech/maxim" }
Expand All @@ -51,20 +67,23 @@ is-it-maintained-open-issues = { repository = "katharostech/maxim" }
maintenance = { status = "actively-developed" }

[dev-dependencies]
env_logger = "^0.7.1"
tracing-subscriber = "0.2.5"
rand = "^0.7"
serde_json = "^1.0.40"

[dependencies]
bincode = "1.1.4"
dashmap = "1.0.3"
futures = "0.3.1"
num_cpus = "1.10.1"
log = "0.4"
smol = "0.1.4" # Async Executor
piper = { path = "lib/piper" } # Async pipes, channels, mutexes, and more
futures = { version = "0.3.1", default-features = false } # Async Utils
serde = { version = "1.0.97", features = ["derive", "rc"] } # Serialization support
bincode = "1.1.4" # RPC Serialization
dashmap = "1.0.3" # Concurrent hashmap
tracing = "0.1.13" # Tracing ( like logging with spans and extra event data )
tracing-futures = { version = "0.2.4", default-features = false, features = ["futures-03"] }
async-trait = "0.1.30" # Macro for creating async traits
uuid = { version = "0.8.1", features = ["serde", "v4"]} # UUID Generation
once_cell = "1.0.2"
secc = "0.0.10"
serde = { version = "1.0.97", features = ["derive", "rc"] }
uuid = { version = "0.8.1", features = ["serde", "v4"]}
rand = { version = "0.7.3", optional = true }
rand_xoshiro = { version = "0.4.0", optional = true }

rand = { version = "0.7.3", optional = true } # Random support
rand_xoshiro = { version = "0.4.0", optional = true } # Fast random number generator
num_cpus = { version = "1.10.1", optional = true } # Detect number of CPUs
async-channel = "1.1.0"
3 changes: 3 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ allow = [
"MIT",
"Apache-2.0",
"BSD-2-Clause",
# TODO: This the license for `wepoll-binding` and `wepoll-sys` and I'm
# pretty sure we don't mind MPL, but it would be good to double-check.
"MPL-2.0",
]
# List of explictly disallowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
Expand Down
2 changes: 2 additions & 0 deletions examples/montecarlo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ impl Game {
// to the `GameManager`.
results_aid
.send_new(GameMsg::new(ctx.aid.clone(), results_vec))
.await
.unwrap();
// Because the `GameManager` is monitoring this actor, sending the `Stop` status
// will inform the manager that this game is now completed.
Expand Down Expand Up @@ -153,6 +154,7 @@ impl GameManager {
.spawn()
.name(&name)
.with(game_conditions, Game::play)
.await
.unwrap();
ctx.system.monitor(&ctx.aid, &aid);
aid.send_new(ctx.aid.clone()).unwrap();
Expand Down
19 changes: 6 additions & 13 deletions examples/philosophers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
//! badly timed messages. This is largely up to the user.

use maxim::prelude::*;
use log::LevelFilter;
use log::{error, info};
use tracing::{error, info};

use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::env;
Expand Down Expand Up @@ -438,17 +438,10 @@ struct EndSimulation {}
/// actors.
pub fn main() {
let args: Vec<String> = env::args().collect();
let level = if args.contains(&"-v".to_string()) {
LevelFilter::Debug
} else {
LevelFilter::Info
};

env_logger::builder()
.filter_level(level)
.is_test(true)
.try_init()
.unwrap();

tracing_subscriber::fmt()
.with_max_level(tracing::Level::TRACE)
.init();

// FIXME Let the user pass in the number of philosophers at the table, time slice
// and runtime as command line parameters.
Expand Down
1 change: 1 addition & 0 deletions lib/piper
Submodule piper added at 73e7b4
Loading