Channel take if available

Looks like we do not have such function yet based on the last paragraph in add maybetake! and tryput! by tkf · Pull Request #41966 · JuliaLang/julia · GitHub

Note also that this PR does not implement the “non-blocking” version of put/take. However, it is conceivable to add maybetake_nowait! and tryput_nowait! in the future (with a warning in the docstring that they are “racy” APIs and it is discouraged to use them, unless you know what you are doing.)

1 Like