Skip to content

Commit

Permalink
v0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Jul 30, 2022
1 parent a20ec04 commit 466343c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.12.0 - 2022-07-30

- The `gleam/erlang/process.select_forever` function no longer returns a result.

## v0.11.0 - 2022-07-30

- The `gleam/erlang/process` module gains the `send_after`, `cancel_timer`,
Expand Down
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "gleam_erlang"

version = "0.11.0"
version = "0.12.0"
licences = ["Apache-2.0"]
description = "A Gleam library for working with Erlang"

Expand Down
2 changes: 1 addition & 1 deletion src/gleam/erlang/process.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub external fn select(
/// Similar to the `select` function but will wait forever for a message to
/// arrive rather than timing out after a specified amount of time.
///
pub external fn select_forever(from: Selector(payload)) -> Result(payload, Nil) =
pub external fn select_forever(from: Selector(payload)) -> payload =
"gleam_erlang_ffi" "select"

/// Add a new `Subject` to the `Selector` to that it's messages can be received.
Expand Down
3 changes: 2 additions & 1 deletion src/gleam_erlang_ffi.erl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ insert_selector_handler({selector, Handlers}, Tag, Fn) ->
{selector, Handlers#{Tag => Fn}}.

select(Selector) ->
select(Selector, infinity).
{ok, Message} = select(Selector, infinity),
Message.

select({selector, Handlers}, Timeout) ->
receive
Expand Down
2 changes: 1 addition & 1 deletion test/gleam/erlang/process_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub fn select_forever_test() {
let subject = process.new_subject()
process.send(subject, 1)

assert Ok(1) =
assert 1 =
process.new_selector()
|> process.selecting(subject, function.identity)
|> process.select_forever
Expand Down

0 comments on commit 466343c

Please sign in to comment.