[swift-evolution] asyncAfter(deadline: ...)
razielim at gmail.com
Wed Jul 27 04:52:11 CDT 2016
> On 27 Jul 2016, at 10:23, Guillaume Lessard via swift-evolution <swift-evolution at swift.org> wrote:
> The newer version of the libdispatch overlay (as of 8ac413a) looks good: thanks for your work Matt!
> It replaced async(when: ) with asyncAfter(deadline: ); however dictionaries say:
> deadline |ˈdedˌlīn|
> 1 the latest time or date by which something should be completed
> dispatch_async’s timestamp is the *earliest* time at which work can be *initiated*, so “deadline” is completely backwards.
> If a label is necessary, “time” would seem just fine, given the new name of the function: asyncAfter(time: ).
> Personally, I don’t think a label is necessary anymore, since the first parameter of asyncAfter is a timestamp type.
> Guillaume Lessard
> swift-evolution mailing list
> swift-evolution at swift.org
Have been saying this for a while. As have many others sporadically on here.
You are correct that the word “deadline” is the exact opposite of what this parameter means. It’s one of several problems with that particular function, but I got the impression the dispatch team really didn’t take kindly to my input last time and were resolute on their internally-decided name (despite the glaring flaw). So don’t expect anything to happen about it.
More information about the swift-evolution