diff --git a/changelog.md b/changelog.md index bf31e94..841992c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## v 1.0.2 + +- Added ability to define a specific machine_id instead of using the node list index mechanism. + ## v 1.0.1 - Introduced a helpful util function to get a snowflake for a specific time. diff --git a/mix.exs b/mix.exs index 5e8e53f..29f8d73 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Snowflake.Mixfile do use Mix.Project - @version "1.0.1" + @version "1.0.2" @url "https://github.com/blitzstudios/snowflake" @maintainers ["Weixi Yen"] diff --git a/readme.md b/readme.md index 699dac7..64e9e41 100644 --- a/readme.md +++ b/readme.md @@ -30,6 +30,14 @@ config :snowflake, epoch: 1142974214000 # don't change after you decide what your epoch is ``` +Alternatively, you specify a specific machine_id + +```elixir +config :snowflake, + machine_id: 23, # values are 0 thru 1023 nodes + epoch: 1142974214000 # don't change after you decide what your epoch is +``` + Generating an ID is simple. ```elixir