bamboo v0.3.2 Bamboo.TaskSupervisorStrategy

Default strategy. Sends an email in the background using Task.Supervisor

This is the default strategy because it is the simplest to get started with. This strategy uses a Task.Supervisor to monitor the delivery. Deliveries that fail will raise, but will not be retried.

To use this strategy, the Bamboo.TaskSupervior must be added to your supervisor. See the docs for child_spec or check out the README.

Summary

Functions

Child spec for use in your supervisor

Functions

child_spec()

Child spec for use in your supervisor

Example

# Usually in lib/my_app_name/my_app_name.ex
def start(_type, _args) do
  import Supervisor.Spec

  children = [
    # Add the supervisor that handles deliver_later calls
    Bamboo.TaskSupervisorStrategy.child_spec
  ]

  # This part is usually already there.
  opts = [strategy: :one_for_one, name: MyApp.Supervisor]
  Supervisor.start_link(children, opts)
end