Skip to content

Commit 53cb1cb

Browse files
committed
Lab10: Fixed exercise solution without asyncmap.
1 parent 57aa590 commit 53cb1cb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/src/lecture_10/lab.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,11 @@ function query_cat_fact()
323323
d["fact"]
324324
end
325325

326+
# without asyncmap
326327
function get_cat_facts_async(n)
327-
facts = String[]
328+
facts = Vector{String}(undef, n)
328329
@sync for i in 1:10
329-
@async facts query_cat_fact()
330+
@async facts[i] = query_cat_fact()
330331
end
331332
facts
332333
end

0 commit comments

Comments
 (0)