Skip to content

Commit 91fa0e3

Browse files
Improve docs for Task mfa field (#11795)
1 parent 1907914 commit 91fa0e3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/elixir/lib/task.ex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,27 +225,30 @@ defmodule Task do
225225
226226
It contains these fields:
227227
228+
* `:mfa` - a three-element tuple containing the module, function name,
229+
and arity invoked to start the task in `async/1` and `async/3`
230+
231+
* `:owner` - the PID of the process that started the task
232+
228233
* `:pid` - the PID of the task process; `nil` if the task does
229234
not use a task process
230235
231236
* `:ref` - the task monitor reference
232237
233-
* `:owner` - the PID of the process that started the task
234-
235238
"""
236-
@enforce_keys [:pid, :ref, :owner, :mfa]
239+
@enforce_keys [:mfa, :owner, :pid, :ref]
237240
defstruct @enforce_keys
238241

239242
@typedoc """
240243
The Task type.
241244
242-
See `%Task{}` for information about each field of the structure.
245+
See [`%Task{}`](`__struct__/0`) for information about each field of the structure.
243246
"""
244247
@type t :: %__MODULE__{
245-
pid: pid() | nil,
246-
ref: reference(),
248+
mfa: mfa(),
247249
owner: pid(),
248-
mfa: mfa()
250+
pid: pid() | nil,
251+
ref: reference()
249252
}
250253

251254
defguardp is_timeout(timeout)

0 commit comments

Comments
 (0)