Am I missing with ref in this code?
Jesse Phillips
Jesse.K.Phillips+D at gmail.com
Sat Jan 26 18:06:46 UTC 2019
On Thursday, 24 January 2019 at 15:28:19 UTC, Suliman wrote:
> I am doing very small link-checker. Here is' code
> https://run.dlang.io/is/p8whrA
>
> I am expecting that on line:
> writefln("url: %s, status: %s", url.url, url.status);
>
> I will print link and it's status. But I am getting only:
> url: http://127.0.0.1:8081/hck, status:
> url: http://127.0.0.1:8081/hck2, status:
> url: http://127.0.0.1:8081/hck3, status:
>
> It's seems that I missed something with refs? Could you help me
> find error?
You're writing asynchronous code and expecting it to process
synchronized. Just make a synchronous call. If you need async use
message passing with concurrency, probability on each call to the
url so you can do the slow operations in parallel.
More information about the Digitalmars-d-learn
mailing list