Thread overview
parallelism with delegate
Sep 22
user1234
September 22

able ?
how to use correctly?

  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

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

September 22

On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev wrote:

>

...

Skip this thread. I see solution.

How to delete missed posts on this forum ?

September 22

On Friday, 22 September 2023 at 04:33:44 UTC, Vitaliy Fadeev wrote:

>

On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev wrote:

>

...

Skip this thread. I see solution.

How to delete missed posts on this forum ?

It's there forever, you have to live with that error ;)

See https://forum.dlang.org/help#about

September 22
On Thursday, September 21, 2023 10:33:44 PM MDT Vitaliy Fadeev via Digitalmars-d-learn wrote:
> On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev
>
> wrote:
> > ...
>
> Skip this thread. I see solution.
>
> How to delete missed posts on this forum ?

This forum is esentially just a web client for some D-specific newsgroups (and a number of folks access it via either the newsgroup interface or its associated mailing list rather than through the web interface). So, you can't edit or remove posts. Admins can remove spam from the newsgroup (and thus the forum), but that's pretty much it, and even then, that doesn't remove it from the mailing list, because you can't get an e-mail back once it's been sent. So, once you send something to the forum, it's out there forever.

- Jonathan M Davis



September 22

On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev wrote:

>

able ?
how to use correctly?

  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

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