async method ?

Discuss the future of the AutoHotkey language
bourdin07
Posts: 36
Joined: 23 Jun 2019, 12:57

async method ?

03 Jul 2019, 16:22

I really wish to see async method in v2, or other possibility to create a worker thread
guest3456
Posts: 3462
Joined: 09 Oct 2013, 10:31

Re: async method ?

03 Jul 2019, 16:26

you could use AHK_H

wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: async method ?

03 Jul 2019, 16:27

Have you tried SetTimer with Period = -1 :?:
bourdin07
Posts: 36
Joined: 23 Jun 2019, 12:57

Re: async method ?

06 Jul 2019, 13:31

hello,
do you have exemple code?
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: async method ?

06 Jul 2019, 13:49

Try this:

Code: Select all

#Persistent
SetTimer, WorkerThread, -1


WorkerThread:
    ToolTip, WorkerThread at work
    sleep, 2000
    ToolTip, WorkerThread done
return
I hope that helps.

This is AHK v1 code!
AHK v2 does not yet offer multithreading, As far as I know.

If your question is not aimed at me, ignore please and sorry. AHK_H is the way to go, as mentioned before.
bourdin07
Posts: 36
Joined: 23 Jun 2019, 12:57

Re: async method ?

25 Jul 2019, 09:19

in my opinion async implementation must be the priority for AutoHotkey v2
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: async method ?

25 Jul 2019, 20:12

Something along the lines of Promises as in JavaScript would be helpful. I’ve considered trying to implement it myself but haven’t taken the dive yet.
User avatar
Ragnar
Posts: 613
Joined: 30 Sep 2013, 15:25

Re: async method ?

26 Jul 2019, 02:31

You can also execute code as a new process. See Run example #3 (ExecScript).
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: async method ?

26 Jul 2019, 21:12

I think this is outside the scope of v2.0 or the development forum. Perhaps Ask for Help/v2 would be more appropriate to explore the current options, otherwise Wish List (although in that case there are sure to be existing topics that cover this).
iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Re: async method ?

28 Jul 2019, 13:18

Something similar is needed for despite there being work-arounds. Hopefully we not Promises though.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: async method ?

28 Jul 2019, 14:05

Care to explain your dissatisfaction with Promises?
iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Re: async method ?

28 Jul 2019, 15:48

They're hard to understand initially, very verbose, and their generalized structure is the monad (which Promises are not.) I skimmed through a few of these articles. 1, 2

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 26 guests