On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev wrote:
able ?
how to use correctly?

```d
  import std.parallelism;

  auto async_task = task!fn( args );  // error
// Error: no property `opCall` for type `app.A`, did you mean `new A`?

  async_task.executeInNewThread();
```

where

```d
auto a = new A();
auto fn = &a.download;

class A
{
    void fn( string url )
    {
        // DO
    }
}
```

Playground:
https://run.dlang.io/is/HvhtoP

gist:
https://gist.github.com/run-dlang/218b69e1afd79e5944ea10aa7ca61e1b

Also check out std.concurrency

Reply via email to