Jump to content

stevegill

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. stevegill

    Using Parameters with Async/Await.

    Thanks Primoz! I love the Omnithread library. It makes things a lot easier. = Steve
  2. stevegill

    Using Parameters with Async/Await.

    Thanks Primoz. Now that I've taken another look at the second code example it's pretty obvious. In the first code snippet, if I dynamically created and destroyed database components in the Async part of the code, I'm assuming that they would be completely isolated from the main thread. Is that correct? = Steve
  3. I'm using Async and Await with two methods. The CheckForDueRemindersProcess method has two var parameters. The intention is to run this in a thread and receive the values via the parameters. The values are then passed to the CheckForDueReminderFinish method, which updates VCL components. Is the following code the correct way to do this? var RemindersDue: Boolean; RemindersCount: integer; begin Async(procedure begin CheckForDueRemindersProcess(RemindersDue, RemindersCount); end).Await(procedure begin CheckForDueRemindersFinish(RemindersDue, RemindersCount); end); end; Another question: is it ok to declare the variables as shown above in the calling method, or should they be declared like this: Async(procedure var RemindersDue: Boolean; RemindersCount: integer; begin CheckForDueRemindersProcess(RemindersDue, RemindersCount); end).Await(procedure begin CheckForDueRemindersFinish(RemindersDue, RemindersCount); end); Thanks. = Steve
×