On Fri, 24 Oct 2014 07:40:07 GMT, Sönke Ludwig wrote:Task.interrupt
should work, though. Using vibe.core.concurrency
it could also be made a bit shorter:
@before!returnResponse("_res") Data waitForUpdatedData(HTTPServerResponse _res, ...) { auto parent = thisTid; Data result; auto disctask = runTask({ try { _res.waitForConnectionClose(); parent.send(false); } catch (InterruptException) return; }); auto workertask = runTask({ try { result = waitingForUpdates(); parent.send(true); } catch (InterruptException) return; }); if (receiveOnly!bool) disctask.interrupt(); else workertask.interrupt(); return data; }
Thanks. This is exactly what I need.