Commit Graph
158 Commits
Author SHA1 Message Date
Jean Klingler 10902df940 More cleanup of older OTP versions (#15170)
* More cleanup since we require OTP 27

* Remove mentions to OTP25- in docs

* Use same versions in Getting Started as in Mix guide
2026-03-10 19:49:17 +09:00
Gonzalo R 7ad99b5590 Fix starter/name in Task's report callback (#14975) 2025-12-01 17:46:41 +01:00
Eksperimental 86d5b3a293 Rephrase docs when mentioning out-of-memory errors (#14727)
Avoid using the term exception as it could be confusing for the user
and mislead him thinking it could be an Elixir `t:Exception.t/0`.
2025-08-28 16:29:34 +02:00
Jean Klingler c6ab1dbbae Fix opaqueness violation in Task.Supervisor (#14656) 2025-07-18 06:42:30 +09:00
Łukasz Samson e3f7759fde Replace keyword with concrete keyword lists in specs (#14611) 2025-06-30 17:24:28 +02:00
Łukasz Samson 54489ef86f Fix time unit in comment (#14600) 2025-06-24 07:09:23 +02:00
Jonatan Männchen 980500551c Inline Licence Info & Copyright for non-test files (#14256) 2025-02-07 21:11:09 +01:00
Jean Klingler 39d1ecb499 Various small improvements in guides and docs (#13887) 2024-10-08 18:05:38 +09:00
Jean Klingler 1286a6257f Replace unless/2 usages in the codebase (#13808) 2024-09-06 16:22:51 +09:00
JoeZ99 8706d02fa2 Update Task.Supervisor.option() (#13704) 2024-07-03 12:56:14 +02:00
Jean Klingler 349321117e Log :$process_label in Task crash report (#13406) 2024-03-16 19:05:47 +09:00
José Valim 31c7557500 Correct task link in docs, closes #13388 2024-03-06 12:59:16 +01:00
Jean KlinglerandAndrea Leopardi 3b5bd6853c Add @type async_stream_option to Task and Task.Supervisor (#13306)
* Add @type async_stream_option to Task and Task.Supervisor

* Update lib/elixir/lib/task.ex

* Update lib/elixir/lib/task/supervisor.ex

---------

Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
2024-01-31 20:01:54 +09:00
Jean Klingler c54ff0e25d Validate options in async_stream* functions (#13289) 2024-01-31 19:56:47 +09:00
Jean KlinglerandAndrea Leopardi 2d50a3612b Document the behavior of async_stream_nolink (#13285)
* Document the behavior of async_stream_nolink

* Apply suggestions from code review

Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>

* Fix format

---------

Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
2024-01-26 21:27:03 +09:00
Juha b09758bcfe Document need of Tasks to trap exits for Task.Supervisor :shutdown to have effect (#13004) 2023-10-13 12:11:50 +02:00
Ievgen Pyrogov 27fabde683 Mention :zip_input_on_exit in Task.Supervisor too (#12814)
It's mentioned in docs to Task.async_stream/5, but not here.
2023-07-23 08:28:58 +02:00
sabiwara 6564e3d2c0 Use process dict directly (#12599) 2023-05-25 21:07:48 +09:00
José Valim ecdf684381 Reduce footprint of tasks
Tasks were launched with proc_lib, which added
additional processing on boot. We removed the
proc_lib layer, which has the benefit of removing
the double logging (which only happened on tasks
but not any other behaviour).
2023-05-25 09:23:16 +02:00
José Valim 633a8d128d Do not copy args on temporary Task.Supervisor.start_child
This reduces memory usage and speeds up the most common
use case of Task.Supervisor. The scenario where Task.Supervisor
has a custom restart non-temporary strategy now is a bit slower
(it requires 2 GenServer calls), but this approach has been
deprecated for several releases already.
2023-03-16 13:01:56 +01:00
José Valim bc0330312e Revert "Add GenServer.async/2 (#12444)"
This functionality unfortunately disables the selective
receive optimizations. We will pursue making this simpler
in Erlang/OTP first.

This reverts commit a98a960f91.
2023-03-05 08:56:14 +01:00
Andrea Leopardi a98a960f91 Add GenServer.async/2 (#12444) 2023-03-04 15:30:58 -06:00
José Valim 79bebf971f Use new Code.loaded?/1 2023-01-06 23:13:56 +01:00
Nick Krichevsky 182c3bacc8 Clarify that Task.Supervisor.async_nolink/3 must also have a :temporary restart strategy (#12257) 2022-11-21 18:40:26 +01:00
Maarten van Vliet 85c38db692 Fix task supervisor name in example (#12230) 2022-11-07 21:50:04 +01:00
José Valim 0a1a5991d9 Remove unecessary parens in nullary type funs 2022-10-14 13:55:23 +02:00
sabiwara 29bf449f3f Evaluate formating charlists as ~c sigils (#12064) 2022-08-10 06:47:00 +02:00
José Valim 239f8f9e3b Require Erlang/OTP 24 2022-07-27 13:20:42 +02:00
José Valim b370341524 Store :mfa in the Task struct (#11794)
This field can be used for reflection purposes.

Closes #11716.
Closes #11720.
2022-05-02 12:08:05 +02:00
José Valim 08edb70dba Only keep input in async_stream if necessary 2022-02-28 09:59:38 +01:00
Vitalik faded51635 Add zip_input_on_exit option to Task.async_stream (#11668) 2022-02-28 09:16:01 +01:00
José Valim 5dec4508d0 Ensure async streams can be consumed from a separate process 2021-12-13 15:45:28 +01:00
José Valim bdff469245 Add PartitionSupervisor (#11468)
A supervisor with that starts multiple partitions of the same child.

Certain processes may become bottlenecks in large systems.
If those processes can have their state trivially partitioned,
in a way there is no dependency between them, then they can use
the `PartitionSupervisor` to create multiple isolated and
independent partitions.

Once the `PartitionSupervisor` starts, you can dispatch to its
children using `{:via, PartitionSupervisor, {name, key}}`, where
`name` is the name of the `PartitionSupervisor` and key is used
for routing.
2021-12-13 15:07:06 +01:00
Rudolf e051a4ed3c Add clarifications to Task.Supervisor.children/1 (#11395)
Children ignored children that are restarting.

Add a caution note about calling the function under low memory condition.
2021-11-16 21:02:58 +01:00
Tyler A. Young cf5bd52059 Corrections & clarifications to Task.Supervisor docs (#11384) 2021-11-12 09:17:49 +01:00
José Valim 186e8629bd Reduce copy of MFAs and values on Task.async* functions
Task.Supervisor.async/* would copy the MFA to the supervisor
process. async_stream/* would additionally copy the value to
the stream coordinator. This commit makes it so those copies
are no longer necessary. The only unnecessary copy is in
Task.Supervisor.start_child/2 which we can't address due to
backwards compatibility.
2021-10-01 23:36:58 +02:00
José Valim 440fa8e997 Add task ignore 2021-10-01 23:36:58 +02:00
felipe stival d220a847b6 Fix redundancies in Task and Task.Supervisor docs (#11196) 2021-08-20 21:26:48 +02:00
Marcio Lopes de Faria 6bffae5caf Task Docs Improvements (#11195) 2021-08-20 19:54:41 +02:00
Adam Rutkowski b5f94ab5d6 Disallow streaming with max_concurrency=0 (#10966) 2021-05-05 21:03:43 +02:00
Domingo Aguilera 2aab858fdc Update supervisor.ex (#10785) 2021-03-11 23:55:09 +01:00
dwiyanr 927d02ba1a Cleanup waiting map on Task.Supervised.stream/6 (#10729)
When running Task.Supervised.stream/6 with ordered options turned off,
the "waiting" map to store the response from task is not cleaned up.
This leads to the response piled up in the map causing memory leak.

This changes cleanup the map of the response that has been delivered to the reducer
function.
2021-02-17 16:07:02 +01:00
José Valim 6bc13297a2 Simplify nested call 2021-02-17 15:59:21 +01:00
José Valim 6570e35f14 Improve Task docs to mention shutdown and different patterns 2021-02-13 09:56:35 +01:00
José Valim 1ec295823f Fix dialyzer specs for Task.Supervisor, closes #10460 2020-10-28 08:51:05 +01:00
Eksperimental 6944a67965 Revise use of Note and Notice verbs (#10264) 2020-08-14 07:59:34 +02:00
Mitchell Henke 291f5e41f2 include callers in translated Logger metadata for Task (#10111) 2020-06-19 20:50:48 +02:00
Ryan Zidago 8fa9b0d954 Fix Task PID and caller in Task Supervisor reports (#10025)
Closes #10024
2020-05-09 01:14:09 +02:00
Michał Łępicki 6c785cdc80 Inline types not exported from their erlang modules (#9976) 2020-04-26 18:19:36 +02:00
José Valim d184045d66 Do not crash on fake down messages on stream monitor, closes #9803 2020-02-12 18:31:17 +01:00