A safe Rust async runtime.
forbid(unsafe_code)
std
stable
requires once_cell
crate which contains some unsafe code.
This is necessary until
std::lazy::OnceCell
is stable.safina_executor::spawn_unpin
.safina_async_test
has an #[async_test]
macro for running async fn
test functions.
rust
let executor = safina::executor::Executor::default();
let (sender, receiver) = std::sync::mpsc::channel();
executor.spawn(async move {
sender.send(()).unwrap();
});
receiver.recv().unwrap();
rust
let result = safina::executor::block_on(async {
prepare_request().await?;
execute_request().await
})?;
smol
unsafe
codeasync-std
unsafe
codefutures
unsafe
codetokio
unsafe
bastion
unsafe
codenostd_async
Promise
with oneshot
, OneSender
, and Receiver
that supports async and blocking reads.schedule_blocking
to return new sync::Receiver
.Executor::new
and Executor::with_name
to return Result
.ThreadPool::new
to return Result
.ThreadPool::try_schedule
to return an error when it fails to restart panicked threads.ThreadPool::schedule
to handle failure starting replacement threads.block_on
functions to take futures that are not Send
.once_cell
by default.once_cell
.safina-net
safina-executor
v0.1.3 APIsafina_sync::Mutex
Box::pin
.safina
crate to safina-executor
.
Added new safina
crate with re-exports, examples, and integration tests.init
function that makes an executor and starts the timer thread.#[async_main]
macroCargo.toml
and bump version number../release.sh
License: Apache-2.0