Created
March 21, 2023 16:03
-
-
Save softberries/552ad6029f0195a4fdd2189c278586c1 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
@default_partition 0 | |
defp partition(msg) do | |
case Jason.decode(msg.data) do | |
{:ok, data} -> | |
:erlang.phash2(data["ride_id"]) | |
_ -> | |
:default_partition | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment