Skip to content

Commit

Permalink
Add optional name parameter forward to WaitGroup#spawn (#15189)
Browse files Browse the repository at this point in the history
  • Loading branch information
spuun authored Nov 15, 2024
1 parent 5e0bbaa commit f4606b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wait_group.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4606b7

Please sign in to comment.