Posted Thu, 16 Nov 2017 08:56:29 GMT in reply to Christian Köstlin
On Sun, 12 Nov 2017 20:44:54 +0100, Christian Köstlin wrote:
I have an application, that uses vibe as an embedded webserver, but at
the same time does some traditional spawn/spawnLinked work.
I am having problems shutting down the system in a controlled manner.
e.g. vibe catches ctrl-c and shuts down the eventloop, but how can I add
to this hook, to shutdown my own thread?
I found some old newsgroup posts that seemed to use module initializer,
perhaps you could go into more detail?
Thanks in advance,
From my application:
shared static ~this() // called on exit
if(webInterface !is null)
webInterface.destruct(); // call destruction routine
GC.collect(); // reduce noice in Valgrind report
GC.minimize();// omit if you don't use it
In the destruction routine, I send exit message to each background task and wait until they exit, something like this: