Skip to content
Merged
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
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ features = ["rt_tokio"]

[dependencies]
tokio = { optional = true, version = "1", features = ["net", "io-util", "sync", "time"] }
async-std = { optional = true, version = "1" }
smol = { optional = true, version = "2" }
nio = { optional = true, version = "0.0" }
glommio = { optional = true, version = "0.9" }

futures-util = { optional = true, version = "0.3", default-features = false, features = ["io"] }
Expand All @@ -29,9 +27,7 @@ base64 = { version = "0.22" }

[features]
rt_tokio = ["__splitref__", "dep:tokio","tokio/net","tokio/io-util","tokio/sync","tokio/time"]
rt_async-std = ["__clone__", "dep:async-std"]
rt_smol = ["__clone__", "dep:smol"]
rt_nio = ["__splitref__", "dep:nio", "dep:tokio","tokio/io-util"]
rt_glommio = ["__splitref__", "dep:glommio", "dep:futures-util"]

### internal ###
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

* Minimal and Efficient : minimal codebase to provide efficient, memory-safe WebSocket handling.

* Multi Environment : `tokio`, `async-std`, `smol`, `nio`, `glommio` are supported as async runtime ( by feature flags `rt_{name}` ).
* Multi Environment : `tokio`, `smol`, `glommio` are supported as async runtime ( by feature flags `rt_{name}` ).

## Note

Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 3
tasks:
CI:
deps:
- for: [tokio, async-std, smol, nio, glommio]
- for: [tokio, smol, glommio]
task: test:rt
vars: { rt: '{{.ITEM}}' }
- task: test:no_rt
Expand Down
28 changes: 4 additions & 24 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//!
//! * Minimal and Efficient : minimal codebase to provide efficient, memory-safe WebSocket handling.
//!
//! * Multiple Environment : `tokio`, `async-std`, `smol`, `nio`, `glommio` are supported as async runtime ( by feature flags `rt_{name}` ).
//! * Multiple Environment : `tokio`, `smol`, `glommio` are supported as async runtime ( by feature flags `rt_{name}` ).
//!
//! ## Note
//!
Expand All @@ -26,11 +26,9 @@
//! * Doesn't builtins `wss://` support.

#[cfg(any(
all(feature="rt_tokio", any(feature="rt_async-std", feature="rt_smol", feature="rt_nio", feature="rt_glommio" )),
all(feature="rt_async-std", any(feature="rt_smol", feature="rt_nio", feature="rt_glommio", feature="rt_tokio" )),
all(feature="rt_smol", any(feature="rt_nio", feature="rt_glommio", feature="rt_tokio", feature="rt_async-std")),
all(feature="rt_nio", any(feature="rt_glommio", feature="rt_tokio", feature="rt_async-std", feature="rt_smol" )),
all(feature="rt_glommio", any(feature="rt_tokio", feature="rt_async-std", feature="rt_smol", feature="rt_nio" )),
all(feature="rt_tokio", any(feature="rt_smol", feature="rt_glommio")),
all(feature="rt_smol", any(feature="rt_glommio", feature="rt_tokio" )),
all(feature="rt_glommio", any(feature="rt_tokio", feature="rt_smol" )),
))]
compile_error! {"More than one runtime feature flags can't be activated"}

Expand All @@ -45,15 +43,6 @@ mod runtime {
tokio::time::sleep
};

#[cfg(feature="rt_async-std")]
pub use {
async_std::net::TcpStream,
async_std::io::ReadExt as AsyncRead,
async_std::io::WriteExt as AsyncWrite,
async_std::sync::RwLock,
async_std::task::sleep
};

#[cfg(feature="rt_smol")]
pub use {
smol::net::TcpStream,
Expand All @@ -66,15 +55,6 @@ mod runtime {
smol::Timer::after(duration).await;
}

#[cfg(feature="rt_nio")]
pub use {
nio::net::TcpStream,
tokio::io::AsyncReadExt as AsyncRead,
tokio::io::AsyncWriteExt as AsyncWrite,
tokio::sync::RwLock,
nio::time::sleep
};

#[cfg(feature="rt_glommio")]
pub use {
glommio::net::TcpStream,
Expand Down