sisungo / airup

🚀 Airup is a modern, portable and blazingly fast implementation of service supervisor and the init daemon.
MIT License
18 stars 1 forks source link

Lifetime issues with `<airup_sdk::nonblocking::Connection as airup_sdk::Connection>::invoke` #25

Open sisungo opened 9 months ago

sisungo commented 9 months ago

It's hard to use the following pattern with current implementation due to lifetime issues:

async fn with_connection<T, F: Future<Output = Result<T, airup_sdk::ipc::Error>>>(
    &self,
    f: impl FnOnce(&mut Connection) -> F,
) {
    /* ... */
}

self.with_connection(|conn| conn.trigger_event(&event)).await;

The plan is:

sisungo commented 9 months ago

Priority: Low-Medium.