等待异步咕噜任务完成 [英] Wait async grunt task to finish

查看:148
本文介绍了等待异步咕噜任务完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了一个咕噜设置,其中一个新任务应该执行(grunt.task.run)已经存在的任务。要执行的任务是异步的,新任务应该等到异步任务完成。



这样做的首选方法是什么? grunt已经覆盖了这个,你应该把你的任务声明为异步的,并且在你的任务中使用done()函数来告诉grunt它已经完成了,看看这个repo 这篇文章,当我第一次处理异步任务时,这对我非常有帮助。



没有瞥见你的grunt文件,这是我所能说的,但免费更新你的文章链接到grunfile:)


I received a grunt setup and one of the new tasks should execute (grunt.task.run) already existing task. The task to execute is asynchronous, and the new task should wait until the async task has finished.

What is the preferred way to do this?

解决方案

grunt already got this covered, you should declare your task as an async one, and use the done() func in your task to tell grunt that it is done, look at this repo and this article, that have been very helpfull to me when I first had to deal with async tasks.

without a glimpse at your gruntfile, this is all i could say, but fell free to update your post with a link to the grunfile :)

这篇关于等待异步咕噜任务完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆