-
-
Save vishnevskiy/ddfb274ed64c58bfa7387147b03320f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
semaphore_name = :my_sempahore | |
semaphore_max = 10 | |
case Semaphore.call(semaphore_name, semaphore_max, fn -> :ok end) do | |
:ok -> | |
IO.puts "success" | |
{:error, :max} -> | |
IO.puts "too many callers" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my_sempahore