Reactor, fiber scheduler and async in Ruby 3.0

ikod igor.khasilev at gmail.com
Thu Dec 31 17:21:19 UTC 2020


On Thursday, 31 December 2020 at 16:32:17 UTC, Adam D. Ruppe 
wrote:
> On Thursday, 31 December 2020 at 14:53:52 UTC, Jacob Carlborg 
> wrote:
>> The existing IO related methods in the core/standard library 
>> has been updated to be fiber scheduler aware. That basically 
>> means that if there is no fiber scheduler set, the IO 
>> operations will be blocking. If a fiber scheduler has been 
>> set, they will instead be non-blocking.
>
> omg that's a really good idea.
>
> Over the weekend I wrote a Phobos subclass 
> <http://dpldocs.info/experimental-docs/arsd.fibersocket.html> 
> that does fiber sockets. Pretty simple code really.

Yes, this is how I implemented this in my event loop framework:
https://github.com/ikod/hio/blob/master/source/hio/socket/package.d#L1275

Then your application can just ignore details of underlying 
socket implementation (it can be std.socket or unblocking sockets 
with event loop)




More information about the Digitalmars-d mailing list