Procedural macros for compio.
This crate provides convenience macros for working with the compio runtime, making it easier to write async applications.
#[compio::main]- Marks an async function as the entry point, setting up the compio runtime#[compio::test]- Marks an async function as a test, running it on a compio runtime
Both main and test are re-exported in compio crate when macros feature is enabled:
cargo add compio --features macrosExample:
#[compio::main]
async fn main() {
println!("Hello from compio!");
}You can customize the runtime through params:
#[compio::main(event_interval = 4, with_proactor(capacity = 16))]
async fn main() {
println!("Hello from compio!");
}