Skip to content

Add async support #4

@Cassy343

Description

@Cassy343

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions