Skip to content

Commit b693341

Browse files
committed
added proper 'recv' API
1 parent 2544b57 commit b693341

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

threading/channels.nim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ proc recv*[T](c: Chan[T], dst: var T) {.inline.} =
390390
## Receives item from the channel (blocking).
391391
discard channelReceive(c, dst.addr, sizeof(dst), true)
392392
393+
proc recv*[T](c: Chan[T]): T {.inline.} =
394+
## Receives item from the channel (blocking).
395+
discard channelReceive(c, dst.addr, sizeof(dst), true)
396+
393397
proc recvIso*[T](c: Chan[T]): Isolated[T] {.inline.} =
394398
var dst: T
395399
discard channelReceive(c, dst.addr, sizeof(dst), true)

0 commit comments

Comments
 (0)