On Fri, 14 Apr 2017 13:50:56 GMT, Sönke Ludwig wrote:

On Thu, 06 Apr 2017 15:48:37 GMT, MicroWah wrote:

I am new to vibe.d but not to D.

I am trying to use vibe.d to fetch some remote data from within a Generator.
The simplified problematic code pattern looks like this:

    auto g = new Generator!int({
        auto t = runTask({});


This fails at runtime with:

core.exception.AssertError@../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/core/task.d(49): Invalid or null fiber used to construct Task handle.

Tested with 0.7.30 and 0.8.0-beta.5 and both dmd and ldc so I'm assuming that I'm doing something wrong. Is it because vibe.d can't properly schedule the nested Fiber created within the Generator Fiber?

How to use vibe.d async goodness requestHTTP or runTask from within a Fiber?

I love the library design Sönke, very impressive work!

I've opened a ticket and a fix is underway: #1742

The assertion is simply based on a wrong assumption and can be removed.

Thanks a lot Sönke!