Trouble with Intuiface Asset Creation

composer

#1

Hi!

I have successfully created several intuiface assets already using the “worker generator” Intuiface provides for converting .dlls to .ifd files. Yet, now I am trying to create an interface asset which will use API calls to gather data (previously was obtained via a RSS feed). My code works within visual studio, yet fails when I add the .dll as an Intuiface asset (the intuiface program loads on startup indefinitely). Can you provide me with information about how to make API calls within intuiface assets?

Within my code, I use multithreading to await the httprequest. When I place a small three second delay post the http call (long enough for the API call to complete), and then upload the file as an intuiface asset, the program works. Nevertheless, when I use a while statement to wait for the API thread to end, intuiface once again fails to load. Can you provide me more information about using asynchronous calls/mulithreading within intuiface assets? Or perhaps more information about how Intuiface loads? Thanks,

Ben


#2

Hi Ben !

When using asynchronous calls and multithreading, if you have some part of code waiting for the result of another thread, be careful to always wait in another thread.
If your method is exposed as an Interface Asset action called by IntuiFace, this call can be executed on the main UI thread, and in this case, directly waiting inside this method can cause UI freeze or even totally block the application in some case.

Jeremie