Skip to content

Running host objects on a different thread to avoid hanging app? #2916

Answered by jaredkrinke
jaredkrinke asked this question in Q&A
Discussion options

You must be logged in to vote

I never found any built-in support for exposing async methods on host objects that actually run async, so...

My solution was to move methods that could be slow to a thread pool and then expose everything as a JavaScript promise by passing resolve and reject from new Promise((resolve, reject) => ... to my native code and marshal the IDispatch interfaces over to the thread pool thread where they eventually get called to resolve or reject the promise.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@lightheart33
Comment options

@jaredkrinke
Comment options

@lightheart33
Comment options

Answer selected by jaredkrinke
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants