# wait(::Task) deprecated in 0.7?

**URL:** <https://discourse.julialang.org/t/wait-task-deprecated-in-0-7/12083>\
**Category:** General Usage\
**Created:** [June 30, 2018, 5:53pm UTC](https://discourse.julialang.org/t/wait-task-deprecated-in-0-7/12083 "2018-06-30T17:53:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [June 30, 2018, 5:53pm UTC](https://discourse.julialang.org/t/wait-task-deprecated-in-0-7/12083/1 "2018-06-30T17:53:00Z")

</div>

I found this on the build log for [StringEncodings.jl](https://github.com/JuliaStrings/StringEncodings.jl).

```julia
┌ Warning: `wait(t::Task)` is deprecated, use `fetch(t)` instead.
│ caller = wait(::OutputCollector) at OutputCollector.jl:158
└ @ BinaryProvider OutputCollector.jl:158

```

But, I thought `fetch` is supposed to return results and `wait` does not… They are not the same thing.

I then checked the online help and it seems to indicate proper usage of `wait(t::Task)`:

```julia
  wait([x])

  Block the current task until some event occurs, depending on the type of the argument:

    • Channel: Wait for a value to be appended to the channel.

    • Condition: Wait for notify on a condition.

    • Process: Wait for a process or process chain to exit. The exitcode field of a process can be used to determine success
        or failure.

    • Task: Wait for a Task to finish. If the task fails with an exception, the exception is propagated (re-thrown in the
        task that called wait).

    • RawFD: Wait for changes on a file descriptor (see the FileWatching package).

  If no argument is passed, the task blocks for an undefined period. A task can only be restarted by an explicit call to schedule
  or yieldto.

  Often wait is called within a while loop to ensure a waited-for condition is met before proceeding.

```

I tried to get more info from [NEWS.md](https://github.com/JuliaLang/julia/blob/master/NEWS.md) but it doesn’t quite tell me exactly what’s the change:

```julia
wait and fetch on Task now resemble the interface of Future.

```

---

<div class="post-metadata">

**Author:** ![jameson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jameson/32/23_2.png) [@jameson](https://discourse.julialang.org/u/jameson)\
**Post date:** [June 30, 2018, 6:32pm UTC](https://discourse.julialang.org/t/wait-task-deprecated-in-0-7/12083/2 "2018-06-30T18:32:59Z")

</div>

Right. The confusion was that Task wasn’t consistent with your expectation. We will keep ‘wait’, it just won’t return a value anymore. It sounds like you can just ignore the deprecation warning.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [June 30, 2018, 8:56pm UTC](https://discourse.julialang.org/t/wait-task-deprecated-in-0-7/12083/3 "2018-06-30T20:56:34Z")

</div>

Argh… that makes perfect sense. The deprecation detector isn’t smart enough to see the difference between `wait(t)` and `x = wait(t)`, where only the latter case should be considered deprecated usage. So I guess the most sensible approach would be to just _wait it out_ until Julia 1.0.
