Skip to content

Commit bfa94e2

Browse files
committed
Changelog, remove node.to_atom
1 parent 136c250 commit bfa94e2

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

CHANGELOG.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22

33
## v1.0.0-rc1 - Unreleased
44

5-
- The `gleam/erlang/os` module has been removed.
6-
- The `gleam/erlang` module has been removed.
7-
- The `gleam/erlang/reference` module has been created with the `Reference`
8-
type, and the `new` function.
5+
- In the `gleam/erlang/process` module:
6+
- The `Name` type has been introduced. This type is used to give processes
7+
names, making it easier to pass references around your application, and to
8+
have a new process take over a role from a previous one that has crashed.
9+
- In the `gleam/erlang/node` module:
10+
- The `send` function now sends messages in the same format as the `send`
11+
process from the `gleam/erlang/process` module.
12+
- The `send` function now accepts a `Name` rather than an `Atom`.
13+
- The `to_atom` function has been removed.
14+
- The `gleam/erlang/reference` module has been created with:
15+
- The `Reference` type.
16+
- The `new` function.
17+
- The `gleam/erlang/application` module was created with:
18+
- The `priv_directory` function, formerly of the `gleam/erlang` module.
19+
- The `StartType` type.
920
- In the `gleam/erlang/atom` module:
1021
- The `AtomNotLoaded` type has been removed.
1122
- The error type of `from_string` is now `Nil`.
1223
- The `from_string` function has been renamed to `get`.
1324
- The `create_from_string` function has been renamed to `create`.
14-
- The `gleam/erlang/application` module was created with:
15-
- The `priv_directory` function, formerly of the `gleam/erlang` module.
16-
- The `StartType` type.
25+
- The `gleam/erlang` module has been removed.
26+
- The `gleam/erlang/os` module has been removed.
1727

1828
## v0.34.0 - 2025-02-02
1929

src/gleam/erlang/node.gleam

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,11 @@ pub type ConnectError {
4545
pub fn connect(node: Atom) -> Result(Node, ConnectError)
4646

4747
// TODO: test
48-
// TODO: document
49-
// TODO: decide if this should send to just a name of if it should require the
50-
// programmer to create a subject first. Current thought is that name is
51-
// better because a subject could hold a pid which would already know
52-
// what node it is on, so doesn't make as much sense to duplicate that here.
53-
// Oh! Wait! Why couldn't a subject specify where the node is?
5448
/// Send a message to a named process on a given node.
5549
///
56-
/// These messages are untyped, like regular Erlang messages.
50+
/// This function sends messages in the same format as the send function in the
51+
/// process module, so messages sent using it can be received as normal using
52+
/// subjects and selectors.
5753
///
5854
pub fn send(node: Node, name: Name(message), message: message) -> Nil {
5955
raw_send(#(name, node), #(name, message))
@@ -65,8 +61,3 @@ fn raw_send(
6561
receiver: #(Name(message), Node),
6662
message: #(Name(message), message),
6763
) -> DoNotLeak
68-
69-
/// Convert a node to the atom of its name.
70-
///
71-
@external(erlang, "gleam_erlang_ffi", "identity")
72-
pub fn to_atom(node: Node) -> Atom

test/gleam/erlang/node_tests.gleam

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,3 @@ pub fn connect_not_alive_test() {
1717
let name = atom.create("not_found@localhost")
1818
let assert Error(node.LocalNodeIsNotAlive) = node.connect(name)
1919
}
20-
21-
pub fn to_atom_test() {
22-
let assert "nonode@nohost" = atom.to_string(node.to_atom(node.self()))
23-
}

0 commit comments

Comments
 (0)