Skip to content

Commit

Permalink
Improve nested tasks example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Feb 26, 2019
1 parent a39b314 commit ad19632
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def nested_sleepy(task: Async::Task.current)
end

Async do |task|
subtask = nested_sleepy
subtask = nested_sleepy(task: task)
end
```

This method effectively creates a child task. It's the most efficient way to schedule a task. The task is executed until the first blocking operation, at which point it will yield control and `#async` will return. The result of this method is the task itself.
This example creates a child `subtask` from the given parent `task`. It's the most efficient way to schedule a task. The task is executed until the first blocking operation, at which point it will yield control and `#async` will return. The result of this method is the task itself.

### Waiting for Results

Expand Down

0 comments on commit ad19632

Please sign in to comment.