Skip to content

Commit 50bb1ed

Browse files
committed
Use proc_lib
1 parent 1fc6f96 commit 50bb1ed

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
of `call` and `call_forever`.
1717
- The `CallError` type has been removed.
1818
- The `start` function has been replaced by the `spawn` and `spawn_unlinked`
19-
functions.
19+
functions. These functions use the Erlang `proc_lib` spawn functions and so
20+
benefit from the functionality described in the
21+
[`proc_lib` documentation](https://www.erlang.org/doc/apps/stdlib/proc_lib.html).
2022
- The `subject_owner` function now returns a result as a named subject may not
2123
have any process registered for that name.
2224
- The `selecting_*` functions have been replaced by the

src/gleam/erlang/process.gleam

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ pub fn self() -> Pid
2828
///
2929
/// [1]: https://www.erlang.org/doc/reference_manual/processes.html
3030
///
31-
@external(erlang, "erlang", "spawn_link")
31+
/// This function starts processes via the Erlang `proc_lib` module, and as
32+
/// such they benefit from the functionality described in the
33+
/// [`proc_lib` documentation](https://www.erlang.org/doc/apps/stdlib/proc_lib.html).
34+
///
35+
@external(erlang, "proc_lib", "spawn_link")
3236
pub fn spawn(running: fn() -> anything) -> Pid
3337

3438
/// Create a new Erlang process that runs concurrently to the creator. In other
@@ -41,7 +45,11 @@ pub fn spawn(running: fn() -> anything) -> Pid
4145
///
4246
/// [1]: https://www.erlang.org/doc/reference_manual/processes.html
4347
///
44-
@external(erlang, "erlang", "spawn")
48+
/// This function starts processes via the Erlang `proc_lib` module, and as
49+
/// such they benefit from the functionality described in the
50+
/// [`proc_lib` documentation](https://www.erlang.org/doc/apps/stdlib/proc_lib.html).
51+
///
52+
@external(erlang, "proc_lib", "spawn")
4553
pub fn spawn_unlinked(a: fn() -> anything) -> Pid
4654

4755
/// A `Subject` is a value that processes can use to send and receive messages

0 commit comments

Comments
 (0)