Elixir Tips

Elixir Tips

  • Jason Axelson

    axelson

    Generate a unique positive integer

    Generates an increasing integer, that is unique to this BEAM instance.
    iex> System.unique_integer([:positive, :monotonic])
    1
    iex> System.unique_integer([:positive, :monotonic])
    2
    iex> System.unique_integer([:positive, :monotonic])
    3
    15 upvotes