diff --git a/src/wait_group.cr b/src/wait_group.cr index c1ebe67bf508..cf1ca8900e8f 100644 --- a/src/wait_group.cr +++ b/src/wait_group.cr @@ -73,9 +73,9 @@ class WaitGroup # wg.spawn { do_something } # wg.wait # ``` - def spawn(&block) : Fiber + def spawn(*, name : String? = nil, &block) : Fiber add - ::spawn do + ::spawn(name: name) do block.call ensure done