How to turn blocking API in an async API

So I’ve got a USB device that I need to read data from, using a C API (that I bound using PInvoke). Right now with the API I wrote, all of the function calls are blocking, but I’d really like to use it with async/await syntax. So my question is the title: How can I turn a blocking (IO) API into an asynchronous one?

submitted by /u/def-pri-pub
[link] [comments]

Leave a Reply