Skip to content

Commit

Permalink
Guide: ensure url exists in block (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
eval authored Sep 13, 2023
1 parent 22f2f6a commit caeec3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guides/getting-started/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ In some methods, you may want to implement a fan-out or map-reduce. That require

```ruby
def fetch_all(urls, parent: Async::Task.current)
urls.map do
urls.map do |url|
parent.async do
fetch(url)
end
Expand All @@ -136,7 +136,7 @@ or:
```ruby
def fetch_all(urls)
Sync do |parent|
urls.map do
urls.map do |url|
parent.async do
fetch(url)
end
Expand Down

0 comments on commit caeec3b

Please sign in to comment.