Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
feat: add chat-rust-tokio
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <roman@profian.com>
  • Loading branch information
rvolosatovs committed Sep 1, 2022
1 parent fb97348 commit b2a5200
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
strategy:
matrix:
output:
- chat-rust-tokio
- cryptle-rust
- echo-tcp-rust-mio
- echo-tcp-rust-tokio
Expand Down
216 changes: 216 additions & 0 deletions Rust/tokio-chat/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Rust/tokio-chat/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "tokio-chat"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
tokio = { git = "https://github.com/tokio-rs/tokio", rev = "56be5286ee9548c483b91b7593ededcd34c5da0b", default-features = false, features = ["net", "rt", "macros", "io-util", "io-std"] }
21 changes: 21 additions & 0 deletions Rust/tokio-chat/Enarx.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[files]]
kind = "stdin"

[[files]]
kind = "stdout"

[[files]]
kind = "stderr"

[[files]]
name = "ingest"
kind = "listen"
port = 50000
prot = "tcp"
#
#[[files]]
#name = "peer"
#kind = "connect"
#port = 50000
#prot = "tcp"
#host = "localhost"
4 changes: 4 additions & 0 deletions Rust/tokio-chat/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[tokio::main(flavor = "current_thread")]
async fn main() {
println!("test")
}
15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@
rustc = rust;
};
in {
chat-rust-tokio-wasm = naersk-lib.buildPackage {
src = "${self}/Rust/tokio-chat";
CARGO_BUILD_TARGET = "wasm32-wasi";
};

chat-rust-tokio = buildEnarxPackage {
inherit (final) pkgs;
inherit (cargoPackage "${self}/Rust/tokio-chat/Cargo.toml") name version;

wasm = "${final.chat-rust-tokio-wasm}/bin/tokio-chat.wasm";
conf = "${self}/Rust/tokio-chat/Enarx.toml";
};

fibonacci-c-wasm =
final.pkgsCross.wasi32.runCommandCC "fibonacci" {
pname = "fibonacci";
Expand Down Expand Up @@ -276,6 +289,8 @@
packages = with pkgs;
{
inherit
chat-rust-tokio
chat-rust-tokio-wasm
echo-tcp-rust-mio
echo-tcp-rust-mio-wasm
echo-tcp-rust-tokio
Expand Down

0 comments on commit b2a5200

Please sign in to comment.