Scheduler question

Home Forums kbmMW Scheduler question

Viewing 1 reply thread
  • Author
    Posts
    • #54772
      zoran
      Participant

      Hi Kim

      In OnShow event of my main form I have the following code:

      v:= DM.kbmMWPooledSimpleClient1.Request(‘SVC_Common’, ‘1.0’, ‘GetLookupTable’, [‘all’]);
      RefreshLookupAll_LoadTables(v);

      And it works ok. I would like to do it in a thread, but this code doesn’t work:

      Scheduler.Run(procedure
      begin
      v := DM.kbmMWPooledSimpleClient1.Request(‘SVC_Common’, ‘1.0’, ‘GetLookupTable’, [‘all’]);
      end
      )
      .SynchronizedAfterRun(
      procedure
      begin
      RefreshLookupAll_LoadTables(v);
      end
      )
      .Activate(True);

      It never comes to AfterRun part. Variable v is variant declared in global space and nothing is touching it, except this code.

      Is there some settings in kbmMWPooledSimpleClient which should be set? I was not able to figure it out. Am I missing something?

      Thank you.

       

    • #54774
      zoran
      Participant

      Scheduler.Run(procedure(const AScheduledEvent:IkbmMWScheduledEvent)
      begin
      v := DM.kbmMWPooledSimpleClient1.Request(‘SVC_Common’, ‘1.0’, ‘GetLookupTable’, [‘all’]);
      AScheduledEvent.Data := v;
      end
      )
      .SynchronizedAfterRun(
      procedure(const AScheduledEvent:IkbmMWScheduledEvent)
      begin
      RefreshLookupAll_LoadTables(AScheduledEvent.Data);
      end
      )
      .Activate(True);

      Doesn’t work either… 🙁

Viewing 1 reply thread
  • You must be logged in to reply to this topic.