5E Product Walkthrough Playlist
  1. #1

    Asynchronous processing on host - is it possible?

    Is there a way for me to create and spawn another thread running in the background of Fantasy Grounds Unity?

    I just did an experiment in an OnInit kicking off an OOB message that did a few sleeps then printed out when I was exiting OnInit. It was pretty much locked to one thread and did not show my exiting message until I was completely done with the OOB call. I had thought I'd seen some OOB stuff in my logs show that they were processing like they were asynchronous in other extensions. But now I wonder if they were just an illusion of logging or if OnInit is just a special case?

    So is there a way to kick off an asynchronous thread in Fantasy Grounds? I thought it was OOB but it appears that is not the case. At least from OnInit.

  2. #2
    No, the Lua engine state has to be kept synchronous with the UI engine state in order for things to work as expected, and thus runs in the same thread. There is no mechanism for background threads.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    No, the Lua engine state has to be kept synchronous with the UI engine state in order for things to work as expected, and thus runs in the same thread. There is no mechanism for background threads.

    Regards,
    JPG
    Thanks - I'll just have to get creative then

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Storm Kings Thunder Playlist

Log in

Log in