[swift-evolution] LibDispatch : access to current queue, or queue name
Gwynne Raskind
gwynne at darkrainfall.org
Mon Jun 20 04:55:33 CDT 2016
I stand corrected! "currentLabel" would be my prevailing suggestion, then.
-- Gwynne Raskind
> On Jun 20, 2016, at 04:51, Ben Rimmington <me at benrimmington.com> wrote:
>
>
>> On 20 Jun 2016, at 10:14, Gwynne Raskind <gwynne at darkrainfall.org> wrote:
>>
>> dispatch_queue_get_label() isn’t marked as a for-debugging-only API as far as I can see, and I can see uses in non-debugging contexts (logging is the obvious one) for knowing the current queue’s label (without also allowing the error-prone usage of dispatch_get_current_queue() itself). As such, I wouldn’t mind seeing this interface available on DispatchQueue, though I might name it simply "label", as in:
>>
>> extension DispatchQueue {
>> public class var label: String { get }
>> }
>
> Chris Lattner: "Swift supports instance and type members with the same names, but this is controversial, leads to confusion, and may go away in the future."
>
> <http://article.gmane.org/gmane.comp.lang.swift.evolution/14558/match=controversial+confusion+future>
>
> -- Ben
More information about the swift-evolution
mailing list