vibe.d requestHTTP in static this causes infinite loop?

Vijay Nayar madric at gmail.com
Fri May 20 08:52:05 UTC 2022


On Friday, 20 May 2022 at 01:41:59 UTC, Ali Çehreli wrote:
> On 5/19/22 16:44, Vijay Nayar wrote:
>
> > If I remove the call from `static this()`, then the web call
> works as
> > normal. Any idea why calling vibe.d's `requestHTTP` function
> inside of a
> > module's static construction would cause an infinite loop?
>
> I am not experienced with vibe.d.
>
> 'static this' is executed per thread. If requestHTTP starts a 
> new thread, then I can see how you would be in an infinite 
> loop. I wonder whether it should be 'shared static this' (which 
> is executed once per program, not per thread).
>
> Ali

Very clever, you were exactly right. I had not thought of that, 
but that is indeed what was happening.


More information about the Digitalmars-d-learn mailing list