Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typedocs for Worker.return/0 #1108

Merged
merged 6 commits into from
Jun 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/oban/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,20 @@ defmodule Oban.Worker do
alias Oban.{Backoff, Job, Validation}

@type t :: module()

@typedoc """
- `:ok` - the job was successfully processed.
- `{:ok, ignored}` - the job was processed successfully, the return value is
ignored.
- `{:cancel, reason}` - the job was canceled with a reason.
- `{:error, reason}` - the job failed with a reason.
- `{:snooze, seconds}` - the job should be retried after `seconds`.
sorentwo marked this conversation as resolved.
Show resolved Hide resolved

> #### Error {: .warning}
sorentwo marked this conversation as resolved.
Show resolved Hide resolved
>
> - `:discard` - deprecated, use `{:cancel, reason}` or {:error, reason} instead.
> - `{:discard, reason}` - deprecated, use `{:cancel, reason}` or {:error, reason} instead.
sorentwo marked this conversation as resolved.
Show resolved Hide resolved
"""
@type result ::
:ok
| :discard
Expand Down
Loading