Skip to content

Commit

Permalink
clarify why tryTake may be useful
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Aug 16, 2024
1 parent c18e393 commit c421890
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion threading/channels.nim
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ template trySend*[T](c: Chan[T], src: T): bool =
proc tryTake*[T](c: Chan[T], src: var Isolated[T]): bool {.inline.} =
## Tries to send the message `src` to the channel `c`.
##
## The memory of `src` is moved directly.
## The memory of `src` is moved directly. Be careful not to reuse `src` afterwards.
## This proc is suitable when `src` cannot be copied.
##
## Doesn't block waiting for space in the channel to become available.
## Instead returns after an attempt to send a message was made.
##
Expand Down

0 comments on commit c421890

Please sign in to comment.