A safe Rust async runtime.
This crate simply re-exports the various safina-*
crates.
forbid(unsafe_code)
std
stable
requires once_cell
crate which contains some unsafe code.
This is necessary until
std::lazy::OnceCell
is stable.fs
module yet.
async-fs
is a fast async networking library
that works well with Safina. It contains some unsafe code.net
module has poor performance.
async-net
is a fast async networking library
that works well with Safina. It contains some unsafe code.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
})?;
safina_async_test
crate
has an #[async_test]
macro for running async fn
test functions.smol
unsafe
codeasync-std
unsafe
codefutures
unsafe
codetokio
unsafe
codebastion
unsafe
codenostd_async
Changelog
threadpool
module.sync_channel
and SyncSender
.Receiver::async_recv
to let users await without writing ugly (&mut receiver).await
.Receiver::blocking
and add try_recv
, recv
, etc.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]
macroLicense: Apache-2.0