Skip to content

Conversation

1st8
Copy link

@1st8 1st8 commented Jan 30, 2016

Usage of Task.Supervisor.async/4 is meant instead.

Result of running existing example

iex(bar@Christophs-MBP)1> Task.Supervisor.async {KV.RouterTasks, :"foo@Christophs-MBP"}, [Kernel, :node, []]
** (EXIT from #PID<0.101.0>) an exception was raised:
    ** (BadFunctionError) expected a function, got: [Kernel, :node, []]
        :erlang.apply/2
        (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
        (elixir) lib/task/supervised.ex:40: Task.Supervised.reply/5
        (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

Interactive Elixir (1.2.0) - press Ctrl+C to exit (type h() ENTER for help)

Result of running changed example

iex(bar@Christophs-MBP)2> Task.Supervisor.async {KV.RouterTasks, :"foo@Christophs-MBP"}, Kernel, :node, []
%Task{owner: #PID<0.144.0>, pid: #PID<12960.109.0>, ref: #Reference<0.0.8.533>}

Usage of `Task.Supervisor.async/4` is meant instead.
josevalim added a commit that referenced this pull request Jan 30, 2016
Fix example code in distributed-tasks-and-configuration
@josevalim josevalim merged commit 23acf5e into elixir-lang:master Jan 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants