Compute data outside EDT


I would like to run a thread outside EDT that computes some data to be added to a tree's model. Is there any mechanism (some kind of manager or executor) supporting such things in Platform or do I have to do it on my own, manually?

Comment actions Permalink
Official comment

It depends. If you need modal progress, use com.intellij.openapi.progress.ProgressManager#runProcessWithProgressSynchronously. If your thread requires read action and might takes a noticeable time, use ReadTask. Otherwise, Application.executeOnPooledThread might be sufficient.

Comment actions Permalink

Great! This is what I was looking for. Thanks, Peter!


Please sign in to leave a comment.