Created
September 11, 2018 10:35
-
-
Save rafaels88/8eafe1c20105fddbf92d9f419801cc11 to your computer and use it in GitHub Desktop.
Quiqup - Opus Stage Options
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
defmodule Quiqup.DispatchOrderStagePipeline do | |
use Opus.Pipeline | |
import Quiqup.Notifier, only: [emit_event: 1] | |
check :valid_input?, with: &match?(%{order: _}, &1) | |
check :validate_order, error_message: :order_is_not_valid | |
step :assign_next_stage_slug, raise: true, if: :should_assign? | |
step :assign_courier, instrument?: false | |
step :persist_stage, raise: [PersistanceError] | |
step :push_notification, retry_times: 3, retry_backoff: fn -> lin_backoff(10, 2) |> cap(100) end | |
tee :emit_event, with: &emit_event(&1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment