April 30, 2023
On Sunday, 30 April 2023 at 22:10:31 UTC, Cecil Ward wrote:
> How do we wait for an ‘or’ of multiple asynchronous events in this kind of code?

You can set a timeout value for Socket.select, but Phobos isn't going to help you with anything other than sockets and timeouts (despite the fact the underlying operating systems can, in fact, do it).

There's a few other libs that can help with this, including one I'm aiming to release some time in May, or vibe.d has its own ways of doing it, among others. You can also import core.sys.stuff and call the OS functions without a middle man.

But the D stdlib is quite underpowered when it comes to these things. Socket.select is ok but just the basics.
May 01, 2023
On Sunday, 30 April 2023 at 22:37:48 UTC, Adam D Ruppe wrote:
> On Sunday, 30 April 2023 at 22:10:31 UTC, Cecil Ward wrote:
>> How do we wait for an ‘or’ of multiple asynchronous events in this kind of code?
>
> You can set a timeout value for Socket.select, but Phobos isn't going to help you with anything other than sockets and timeouts (despite the fact the underlying operating systems can, in fact, do it).
>
> There's a few other libs that can help with this, including one I'm aiming to release some time in May, or vibe.d has its own ways of doing it, among others. You can also import core.sys.stuff and call the OS functions without a middle man.
>
> But the D stdlib is quite underpowered when it comes to these things. Socket.select is ok but just the basics.

Many thanks, Adam.
1 2
Next ›   Last »