Crates.io | safina-executor |
lib.rs | safina-executor |
version | 0.3.4 |
source | src |
created_at | 2020-12-12 07:38:59.90058 |
updated_at | 2024-10-27 23:40:17.587165 |
description | Safe async runtime executor - ARCHIVED: Code moved to `safina` crate. |
homepage | |
repository | https://gitlab.com/leonhard-llc/safina-rs |
max_upload_size | |
id | 322092 |
size | 45,846 |
This crate is archived and will not be updated.
The code is now at
safina::executor
in the
safina
crate.
An async executor.
It is part of safina
, a safe async runtime.
FnOnce
to run on a separate thread pool
for blocking jobs.forbid(unsafe_code)
std
https://docs.rs/safina-executor
let executor = safina_executor::Executor::default();
let (sender, receiver) = std::sync::mpsc::channel();
executor.spawn(async move {
sender.send(()).unwrap();
});
receiver.recv().unwrap();
let result = safina_executor::block_on(async {
prepare_request().await?;
execute_request().await
})?;
let result = safina_executor::schedule_blocking(|| {
read_file1()?;
read_file2()
}).async_recv().await.unwrap()?;
async-executor
unsafe
codefutures-executor
unsafe
tokio-executor
unsafe
executors
unsafe
codebastion-executor
unsafe
coderayon_core
unsafe
codepollster
unsafe
codelelet
unsafe
codefibers
nostd_async
unsafe
codeembedded-executor
unsafe
codespin_on
pasts
switchyard
unsafe
codesealrs
rusty_pool
safina_sync::Receiver
and safina_threadpool::NewThreadPoolError
.safina-async
v0.2.1.schedule_blocking
to return new safina_sync::Receiver
.Executor::new
and Executor::with_name
to return Result
.safina-threadpool
v0.2.0.block_on
functions to take futures that are not Send
.block_on
and block_on_unpin
when task is awakened a second time.schedule_blocking
and
Executor::schedule_blocking
OnceCell
.safina_threadpool
internally.spawn
and block_on
without
using Box::pin
.
Add spawn_unpin
and block_on_unpin
for folks who need to avoid allocating.
so callers don't have to.safina
#[async_main]
macroflume
to eliminate the receiver mutex and reduce contention.Cargo.toml
and bump version number../release.sh