Skip to content

Commit 793e7ad

Browse files
committed
Fix documentation for receive_forever
1 parent a7dc01e commit 793e7ad

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/gleam/erlang/process.gleam

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,18 @@ pub fn send(subject: Subject(message), message: message) -> Nil
120120
///
121121
/// The `within` parameter specifies the timeout duration in milliseconds.
122122
///
123-
@external(erlang, "gleam_erlang_ffi", "receive")
124-
pub fn receive_forever(from subject: Subject(message)) -> message
125-
126123
@external(erlang, "gleam_erlang_ffi", "receive")
127124
pub fn receive(
128125
from subject: Subject(message),
129126
within timeout: Int,
130127
) -> Result(message, Nil)
131128

129+
/// Receive a message that has been sent to current process using the `Subject`.
130+
///
131+
/// Same as `receive` but waits forever and returns the message as is.
132+
@external(erlang, "gleam_erlang_ffi", "receive")
133+
pub fn receive_forever(from subject: Subject(message)) -> message
134+
132135
/// A type that enables a process to wait for messages from multiple `Subject`s
133136
/// at the same time, returning whichever message arrives first.
134137
///

0 commit comments

Comments
 (0)