Created
November 29, 2018 01:24
-
-
Save matlc/16bcca6a9b7636f46ad29383d55af609 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
def start_flow do | |
streams() | |
|> Flow.from_enumerables() | |
|> Flow.filter(&Regex.match?(~r/publishing/, &1)) | |
|> Flow.map(&get_key_and_payload(&1)) | |
|> Flow.partition(key: {:elem, 0}) | |
|> Flow.reduce(fn -> %{} end, fn x, acc -> | |
Map.put_new(acc, elem(x, 1), elem(x, 2)) | |
end) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment