The only blocking operation in this entire crate is the synchronize method on Core. This should be able to to be readily converted into a future.
This different API could then be exposed through an AsyncWriteHandle type. This type could offload most of its work by forwarding methods on the sync WriteHandle.
One issue to consider is that the WriteHandle currently calls this method on drop. This is not acceptable in an async context and could cause a deadlock. This could likely be solved by offloading the work done there on drop to be done when the Core is dropped. An easy hack for this would be to add a Box<dyn FnOnce(&Self)> to Core called on drop when the async feature is enabled.
The only blocking operation in this entire crate is the
synchronizemethod onCore. This should be able to to be readily converted into a future.This different API could then be exposed through an
AsyncWriteHandletype. This type could offload most of its work by forwarding methods on the syncWriteHandle.One issue to consider is that the
WriteHandlecurrently calls this method on drop. This is not acceptable in an async context and could cause a deadlock. This could likely be solved by offloading the work done there on drop to be done when theCoreis dropped. An easy hack for this would be to add aBox<dyn FnOnce(&Self)>toCorecalled on drop when the async feature is enabled.