One pattern I always use is to get the network calls off the main thread.
我总是用一个模式来获取网络电话关闭主线程。
Datajs USES XMLHttpRequest to make network calls by default, but a different HTTP client can be used.
datajs默认会使用XMLHttpRequest来进行网络调用,但还可以使用不同的HTTP客户端。
allows your thread to block - by calling f.get() - to ensure the network calls succeed, or go away by ignoring f altogether.
可以阻塞线程,再调用f.get()可以让网络调用继续进行或是忽略掉f。
应用推荐