luizamboni
How to create module based Tasks
Im trying reproduce the example of module-based task like the example
in my try
https://github.com/luizamboni/elixir-study/blob/master/otp/5-task/module-task.exs
What is wrong ?
Thanks!
Marked As Solved
net
The docs are wrong.
number = 5
Supervisor.start_link([{TaskModule, number}], strategy: :one_for_one)
Since your module takes a number and adds 2 to it, we’re passing in a number (5) as the argument. You can pass in whatever you like.
See also: Supervisor — Elixir v1.20.2
Also Liked
NobbZ
As you can see, Task.__using__/1 does not exist in v1.4.2, so if you want to use it, you need to update.
https://github.com/elixir-lang/elixir/blob/v1.4.2/lib/elixir/lib/task.ex
Also you can take a look at the documentation of 1.4.2, the example there does not mention any use of use ![]()
luizamboni
thank you !
this forum is observed by core team ?
We can alert about this.
Is a trouble for newbies
Last Post!
OvermindDL1
It is (mostly) but it is still good to submit an issue ticket on github. ![]()
Or better yet, a PR! ^.^
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









