Using the spinner for long-running operations in packages


#1

What is the correct way to show a ui-blocking spinner (with the octocat icon) when doing a long-running operation in packages?

My attempts to get a working code sample from the existing packages and the documentation has been unsuccessful so far.

Thanks


#2

Try looking at the code for the Gist It package … there is an octocat spinner in there.


#3

I was thinking the same the past couple days. Some feedback while the editor is busy would be helpful and relieve frustration on less capable systems. One of my desktops is relatively slow; also with a slow hdd, and sometimes I can’t tell if Atom is simply hung or merely handling a request, ex: deleting a remote folder with a large number of files.

Even better than a basic spinner might be one that provides a dialog of some feedback about the background processes related to whatever we’re waiting for.


#4

You should generally avoid doing anything that blocks the editor. Unless you absolutely have to (to avoid millions of kittens getting slaughtered, or similar), make sure long running tasks are executed asynchronously.

If you need any help or guidance on that, let me (and the rest of the lovely folks here) know.