Skip to content

shark-up/oban-exampme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JobsProcessor


JobsProcessor.HookWorker.new(%{event: "LOGOUT"}) |> Oban.insert()

Multiple jobs can be inserted in a single transaction:

Ecto.Multi.new()
|> Oban.insert(:b_job, MyApp.Business.new(%{id: 1}))
|> Oban.insert(:m_job, MyApp.Mailer.new(%{email: "[email protected]"}))
|> Repo.transaction()
JobsProcessor.HookWorker.new(%{event: "LOGOUT"}, scheduled_at: ~U[2020-12-25 19:00:56.0Z])  |> Oban.insert()

Perform returns

The value returned from perform/1 can control whether the job is a success or a failure:

:ok or {:ok, value} — the job is successful; for success tuples the value is ignored :discard or {:discard, reason} — discard the job and prevent it from being retried again. An error is recorded using the optional reason, though the job is still successful {:error, error} — the job failed, record the error and schedule a retry if possible {:snooze, seconds} — mark the job as snoozed and schedule it to run again seconds in the future. See Snoozing for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published