Comments (4)
Ok, a bit more trial and error yielded an answer...
task(
'someTask'
->
// async task code goes here
complete()
true
)
The parens along with multiline indentation does the trick.
I hate having to use those parens, though, so a suggestion in light of this... Perhaps jake could have a separate function for creating asynchronous tasks named 'asynctask'? In addition to removing the need for one to specify whther a task was asynchronous it would also add clarity for anyone reading the Jakefile as asynchronous tasks would stand out more.
desc 'a normal, synchronous task'
task 'doStuffButMakeThemWait', ->
// synchronous task code goes here
desc 'an asynchronous task'
asynctask 'doStuffTheNodeWay', ->
// asynchronous task code goes here
Just a thought...
from jake.
I'll be happy to add this to the docs if you make it a separate patch that doesn't make changes to the Jake API.
from jake.
No forward motion on this one, closing.
from jake.
@s0nspark did you figure out what the syntax should be for an async task in coffeescript that also has pre-requisites?
I tried your suggested format above, to no avail. I have so far followed the task signature strictly, ordering things correctly, but this one just doesn't seem to want to work.
What I have right now is essentially this:
task 'taskName', ['myPrereqTask'], ->
# async code here, calling complete() when done
, {async: true}
I can't really see anything wrong and was hoping to get your thoughts on this!
UPDATE: actually, see @mde's response here. It sems like when using invoke, you have to manage quite a bit of stuff yourself! So my issue isn't really one of syntax, I don't believe.
from jake.
Related Issues (20)
- Jake is not recognized as cndket/function/script or more,please check the spelling of names HOT 5
- No output for .execSync on Windows HOT 2
- Using import in jakefile HOT 9
- fix file task not working as expect HOT 1
- Security issue
- Possible command injection in jake with publishTask HOT 4
- Can A Rule Be An Async Function?
- Cannot find module 'jake'. WHHAATT!? HOT 9
- Concurrency and invoke() cause prerequisites to be skipped HOT 1
- When can we see the latest version of jakejs published to NPM ? HOT 2
- ChainAlert: npm package release (10.8.3) has no matching tag in this repo
- Error `Cannot read property '1' of null` when running `jake -T` HOT 4
- Update "async": Security vulnerability, prototype pollution HOT 14
- Crash when running a ES6 Jakefile
- Security issue HOT 1
- FileList glob expressions containing * or ** do not match any files on Windows
- Jake fails to properly use environment variables passed as arguments when value contains equal sign HOT 4
- File task dependency handling buggy
- --tasks print source code of jakefile.js HOT 1
- Copyright information
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jake.