D and Async I/O

Steven Schveighoffer schveiguy at gmail.com
Mon May 11 21:15:28 UTC 2020


On 5/11/20 3:46 PM, ikod wrote:
> On Monday, 11 May 2020 at 17:34:41 UTC, Jacob Carlborg wrote:
>> On 2020-05-11 16:44, Russel Winder wrote:
>>
>>> Crickey, a third option. This wil increase my dithering! ;-)
>>
>> Forth: Mecca [1] :)
>>
>> [1] https://github.com/weka-io/mecca
> 
> And probably more. At least I also have my async library for network IO.
> 
> It would be nice to have well defined interface for async io. That will 
> allow to choose and test different implementations.

Part of the problem is the different APIs that async libraries use. Some 
use callbacks, some use fibers, maybe some async/await forms.

std.io aims to provide a common interface for async and sync i/o, where 
you choose the driver at the beginning of your program. If written 
properly, it could be a nice way to test code with various drivers 
without having to change code. It would require a Fiber-based approach, 
however.

I have not added an async driver (yet), but it's in my somewhat 
immediate plans to do so, as I want to start using this more (along with 
iopipe). Contributions would be welcome.

https://github.com/MartinNowak/io

-Steve


More information about the Digitalmars-d-learn mailing list