Modern C++ Won't Save Us

evilrat evilrat666 at gmail.com
Fri Apr 30 18:52:50 UTC 2021


On Friday, 30 April 2021 at 18:27:27 UTC, Ola Fosheim Grøstad 
wrote:
>
> So, having an overview over how existing applications are 
> structured would be important for writing a DIP. So you 
> experience here could be useful, I would think?

No, not me. That was just an example on how it currently looks 
like. And that one important details is to make sure there should 
be a way to manually run one loop iteration (aka process events) 
from outside in such cases as above.

Can't find that project now, but I have another simple prototype, 
too bad it simply runs new thread, so this means actually no 
integration. No surprises then, no common API, nothing to agree 
upon on for different loops :/

```d

// Minimal vibe.d example using worker thread parallel to UI 
thread
void runServer()
{
     auto settings = new HTTPServerSettings;
     settings.port = 8080;
	
     listenHTTP(settings, &handler);

     try
       while(processEvents())
         receiveTimeout( msecs(10), (TaskTerm term) { 
exitEventLoop(); } );
     catch (OwnerTerminated e)
         Log.i("exiting worker thread due to owning thread stop");
}
```


More information about the Digitalmars-d mailing list