Skip to content

Commit 54f93ee

Browse files
committed
Add some receive edge case docs
1 parent 91bbf78 commit 54f93ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/gleam/erlang/process.gleam

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,13 @@ pub fn send(subject: Subject(message), message: message) -> Nil {
239239
/// This function will panic if a process tries to receive with a non-named
240240
/// subject that it does not own.
241241
///
242+
/// of note, this function will error even if there are queued up messages
243+
/// within the process' mailbox directed at a named subject that was
244+
/// *previously* registered to this process, and then got re-registered
245+
/// to another.
246+
/// To recieve messages on subjects not directed at the current pid,
247+
/// use `Select`
248+
///
242249
pub fn receive(
243250
from subject: Subject(message),
244251
within timeout: Int,

0 commit comments

Comments
 (0)