Crate asyncute

Source
Expand description

§async + execute = asyncute is a new async executor that execute async futures globally.

§Features:

  1. Trace status and auto remove dead executor, and auto start new executor thread if all exists executor is working or too high backlogs.
  2. unlike smolscale, there is no per-executor queues for queuing Runnable, asyncute only have single global MPMC queue (and all executors receives Runnable from it), so Executor no need to push Runnable back to global queue on droppped.
  3. unlike other library that uses work-stealing queue, asyncute uses bounded channel for get notify if Runnable available, and if channel is full, spawn() will blocking instead of discarding.
  4. uses propagate-panic always, uses std::panic::catch_unwind always. avoid single async task causes entire executor exit unexpectedly.
  5. analysis and profile. it can easy to get the executor’s status (idle, working, running, work loads, etc.), and start/stop profile in runtime to see average Runnable took how many time to run, current alive Runnables, count of ready/pending polls, etc.
  6. spawn new executor manually, wake monnitor manually, and start monitor manually.
  7. runtime configurable Config.

Re-exports§

pub use executor::*;
pub use defer::*;
pub use util::*;
pub use id::*;

Modules§

defer
defer.rs
executor
executor.rs
id
id.rs
util
util.rs

Macros§

option_try
helper macro for use “try” (? operator) for Option in constant context.
option_unwrap
helper macro for use Option::unwrap() in constant context.
result_try
helper macro for use “try” (? operator) for Result in constant context.
result_unwrap
helper macro for use Result::unwrap() in constant context.

Structs§

Config
The Configuration of Asyncute.
ExecutorConfig
Configuration of Executor.
ExecutorStatus
the status snapshot of executors.
FutureProfile
the Profile of Future.
MonitorConfig
Configuration of Monitor.
Profile
the Profile of asyncute.
ProfileConfig
Configuration of Profile.
RunnableProfile
the Profile of Runnable.
TaskInfo
the information associated to each Task and Runnable.
TaskInfoInner
the inner of TaskInfo.

Enums§

ExecutorSpawnPolicy
Defines how the executor spawns additional threads to handle workload.

Constants§

RUNINFO_CHANNEL_CAPACITY
the maximum capacity of RunInfo global channel.

Functions§

cpu_count
cached, fallbacking, and usize version of std::thread::available_parallelism.
get_monitor_intervalDeprecated
Deprecated
is_monitor_running
Check whether the monitor is running normally.
scheduler
the scheduler of asyncute.
set_monitor_intervalDeprecated
Deprecated
spawn
spawn new Future to asyncute, and return the Task handle associated to this Future.
spawn_executor
force to spawn new executor.
start_monitor
start monitor if it is not exists or exited.
wake_monitor
wake the monitor manually.

Type Aliases§

ExecutorId
alias type for Executor ID (currently u128).
Runnable
the async_task::Runnable type with TaskInfo
Task
the async_task::Task type with TaskInfo
TaskId
alias type for Task ID (currently u128).