On Mon, 22 Sep 2014 08:31:46 +0200, Sönke Ludwig wrote:

Is it because if we quit one temporary event loop we would just continue to the next one, once we reach the next blocking operation in the module ctor?

More the latter, and even on a lower level. For example a socket read is
usually implemented similar to this:

while (bytes_read < bytes_to_read) {
     if (!try_to_read_some_bytes(&bytes_read))
         wait_for_socket_to_become_ready();
}

Now in the non-event-loop case, the wait function would simply run such
a temporary loop (instead if yield()ing). But when this loop gets
terminated, it would simply go to the next while loop iteration and
would wait again. So in the end wait would have to throw an
exception to not cause strange effects within the normal program flow.

Yes, that's exactly what I meant. Hmm, I'll have to think about this.

BTW, I have noticed that an exception is thrown when you run a vibed app like ./app | tee file.txt and then Ctrl-C. vibed complains about a broken log file descriptor or something. But this does not happen when the logging output is being (re)directed to the console or to a file. Hmmm.

BTW 2: If I try to reply after being automatically logged out, the reply failing (because without being logged in the email field is not filled-in), and then try to log in, it HTTP 500s. Hadn't we discussed and solved this before?

object.Exception@../vibe/source/vibe/utils/dictionarylist.d(154): Accessing non-existent key 'group'.
----------------
./vibenews(pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong)+0x6b) [0x7d6fef]
./vibenews(vibe.utils.dictionarylist.DictionaryList!(immutable(char)[], true, 16).DictionaryList.opIndexinout(pure @safe inout(immutable(char)[]) function(immutable(char)[]))+0xa7) [0x960b2f]
./vibenews(void vibenews.web.WebInterface.showPostArticle(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0xfb) [0x8e577f]
./vibenews(void vibe.http.router.URLRouter.handleRequest(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse).void __lambda3!(ulong, immutable(char)[][]).__lambda3(ulong, scope immutable(char)[][])+0x1dc) [0x94e888]
./vibenews(void vibe.http.router.MatchTree!(vibe.http.router.Route).MatchTree.match(immutable(char)[], scope void delegate(ulong, scope immutable(char)[][]))+0x1dc) [0x94eec8]