mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 21:21:32 +00:00
xenevtchn: implement async processing model
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
use xenevtchn::error::Result;
|
||||
use xenevtchn::EventChannel;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let mut channel = EventChannel::open()?;
|
||||
println!("Channel opened.");
|
||||
let port = channel.bind_unbound_port(1)?;
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let channel = EventChannel::open().await?;
|
||||
println!("channel opened");
|
||||
let port = channel.bind_unbound_port(0).await?;
|
||||
println!("port: {}", port);
|
||||
channel.unbind(port)?;
|
||||
channel.unbind(port).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user