ease.js - Tasks: task #12107, Async/delay keyword (promises?)
You are not allowed to post comments on this tracker with your current authentication level.
task #12107: Async/delay keyword (promises?)
Submitter: | Mike Gerwitz <mikegerwitz> | ||
Submitted: | Sun 10 Jun 2012 03:58:12 AM UTC | ||
Should Start On: | Fri 01 Mar 2013 05:00:00 AM UTC | Should be Finished on: | Mon 01 Jul 2013 04:00:00 AM UTC |
Category: | Core | Priority: | 5 - Normal |
Item Group: | Development | Status: | None |
Privacy: | Public | Assigned to: | mikegerwitz |
Percent Complete: | 0% | Open/Closed: | Open |
Planned Release: | None | ||
Keywords: | async |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
No changes have been made to this item
Powered by Savane 3.13-f8d8.
Corresponding source code
Add an `async` or (less likely) `delay` keyword for method declarations. This would provide an alternative for:
The above code is very useful for:
Both of the above code examples are unnecessary and messy if a keyword can satisfy this for us. The value returned from the method (since the call would become asynchronous) has yet to be determined. The options are:
The problem with returning a promise is that it'll prevent method chaining (unless we get creative or returned the object as a property, which can get ugly). The benefit is that it will reduce the code that the developer has to write. If a promise is provided, the developer may still choose to ignore it and instead implement a callback. Alternatively, we could add another ``promise`` keyword if the developer wishes for a promise to be returned, but that's getting messy (just throwing ideas out).
This idea will be explored further in the future. The goal is simply to (a) reduce unnecessary code and (b) encourage consistency. This will also provide a very basic way of making classes asynchronous, but that core concept will need additional consideration in the future.