safina
A safe Rust async runtime.
Features
forbid(unsafe_code)- Depends only on
std - Good test coverage (>95%)
Limitations
- Building on
stablerequiresonce_cellcrate which contains some unsafe code. This is necessary untilstd::lazy::OnceCellis stable. - Allocates memory. You can avoid allocations by using advanced functions, like
safina_executor::spawn_unpin. - Not optimized
Documentation
safina_async_test
has an #[async_test] macro for running async fn test functions.
Examples
let executor = default;
let = channel;
executor.spawn;
receiver.recv.unwrap;
let result = block_on?;
Alternatives
smol- Popular
- Contains some
unsafecode
async-std- Very popular
- Contains generous amounts of
unsafecode
futures- Very popular
- Contains generous amounts of
unsafecode
tokio- Very popular
- Fast
- Internally extremely complicated
- Full of
unsafe
bastion- Generous amounts of
unsafecode
- Generous amounts of
nostd_async
Changelog
- v0.3.2 - Add
threadpoolmodule. - v0.3.1
- Add
sync_channelandSyncSender. - Add
Receiver::async_recvto let users await without writing ugly(&mut receiver).await. - Remove
Receiver::blockingand addtry_recv,recv, etc.
- Add
- v0.3.0
- Move structs into sub-modules.
- Replace
Promisewithoneshot,OneSender, andReceiverthat supports async and blocking reads. schedule_blockingto return newsync::Receiver.
- v0.2.1 - Update docs.
- v0.2.0
Executor::newandExecutor::with_nameto returnResult.ThreadPool::newto returnResult.ThreadPool::try_scheduleto return an error when it fails to restart panicked threads.ThreadPool::scheduleto handle failure starting replacement threads.
- v0.1.10 -
block_onfunctions to take futures that are notSend. - v0.1.9 - Use
once_cellby default. - v0.1.8 - Support stable with rust 1.51 and
once_cell. - v0.1.7 - Add
safina-net - v0.1.6 - Use
safina-executorv0.1.3 API - v0.1.5 - Add
safina_sync::Mutex - v0.1.4 - Upgrade to new safina-executor version which removes need for
Box::pin. - v0.1.3 - Update docs
- v0.1.2 - Renamed
safinacrate tosafina-executor. Added newsafinacrate with re-exports, examples, and integration tests. - v0.1.1 - Add badges to readme
- v0.1.0 - First published version
TO DO
- Add
initfunction that makes an executor and starts the timer thread. - Add an
#[async_main]macro
Release Process
- Edit
Cargo.tomland bump version number. - Run
./release.sh
License: Apache-2.0