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 App.UserService do | |
def create_user(params) do | |
%App.User{} | |
|> App.User.changeset(params) | |
|> App.Repo.insert() | |
|> case do | |
{:ok, user} -> | |
Task.start(fn -> send_email_to_user(user) end) # 🎉 | |
{:ok, user} |
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 YourApp.AccountSetupSupervisor do | |
def set_up_user_account(user) do | |
opts = [restart: :transient] | |
Task.Supervisor.start_child(__MODULE__, YourApp.CRM, :create_user, [user], opts) | |
Task.Supervisor.start_child(__MODULE__, YourApp.Fulfillment, :set_nearest_location, [user], opts) | |
end | |
end |
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 YourApp.CRM do | |
def create_user(user) do | |
crm_data = | |
user | |
|> fetch_crm_data() | |
|> parse() | |
user | |
|> YourApp.User.crm_changeset(crm_data) |
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 Crevalle.Stack do | |
end |
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
%{ | |
configs: [ | |
%{ | |
name: "default", | |
files: %{ | |
included: ["lib/", "src/", "web/", "apps/"], | |
excluded: [~r"/_build/", ~r"/deps/", "**/config/*.exs"] | |
}, | |
requires: [], | |
strict: false, |
OlderNewer