Last active
July 28, 2018 13:07
-
-
Save manoelneto/82f1271139a7bbda905f9ceca22b6647 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 process_message message | |
# encontra os triggers da conta de que essa mensagem foi inserida | |
# primeira filtragem | |
triggers = find_triggers_for_client message | |
# um dos filtros em batch é chamar o servidor de termos booleano | |
triggers = filter_triggers_in_batch message, triggers | |
triggers = triggers.select do |trigger| | |
# verifica se passa nos ultimos filtros | |
trigger.pass_filters? message | |
end.each do |trigger| | |
# executa as ações | |
publish_to_actions_queue trigger, message | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment