Skip to content

Commit

Permalink
Channel receive syntax sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed May 13, 2020
1 parent 4856413 commit af11fde
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions channels.gleam
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import gleam/channel
import gleam/timeout

fn main() {
let c1 = channel.new
let c2 = channel.new
let c3 = channel.new

receive {
OneMsgA = c1 -> 1

OneMsgB = c1 -> 2

Nil = c2 -> Nil

timeout.ms(100) -> "No messages"
}
}

0 comments on commit af11fde

Please sign in to comment.