HISE Logo Forum
    • Categories
    • Register
    • Login

    Background Task || Help me understand this please.

    Scheduled Pinned Locked Moved Unsolved Scripting
    2 Posts 2 Posters 16 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ChazroxC
      Chazrox
      last edited by Chazrox

      I have a heavy token parsing function that crashes when I query large directories. I was told to execute this function on a 'background thread' so I've been looking into it. I just need some clarification from someone with experience with this please.

      I have this function:

      inline function onbtnFindTokenControl(component, value)
      {
      
      // Search files here
      
      }
      btnFindToken.setControlCallback(onbtnFindTokenControl);
      
      

      This function is triggered with a Button on my interface labeled "LOAD".

      Based on what i've read so far....is this pretty much how you do this?

      inline function onbtnFindTokenControl(component, value)
      {
      // Search files here
      }
      btnFindToken.setControlCallback(onbtnFindTokenControl);
      BackgroundTask.callOnBackgroundThread(onbtnFindTokenControl);
      
      // I could put this into the button callback and changed my button callback to 
      // a regular inline function.....is this correct?
      
      
      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @Chazrox
        last edited by

        @Chazrox place your parsing code in a separated function. Then in the button callback, call the background task for the parsing function.
        You shouldn't pass the button callback itself

        Hise made me an F5 dude, browser just suffers...

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        22

        Online

        2.0k

        Users

        12.8k

        Topics

        111.1k

        Posts