From cab0b987f81b8363db7047d5b057e3a897e8a8da Mon Sep 17 00:00:00 2001 From: Andrea Leopardi Date: Sun, 18 Aug 2024 11:05:08 +0200 Subject: [PATCH] Document new feature to Elixir's Oban integration --- docs/platforms/elixir/integrations/oban/index.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/platforms/elixir/integrations/oban/index.mdx b/docs/platforms/elixir/integrations/oban/index.mdx index e000f35f4f9d8..eec0c5832ac3a 100644 --- a/docs/platforms/elixir/integrations/oban/index.mdx +++ b/docs/platforms/elixir/integrations/oban/index.mdx @@ -46,5 +46,13 @@ def before_send(event) do end ``` +The Oban job itself (an [`Oban.Job` struct](https://hexdocs.pm/oban/Oban.Job.html)) is also available inside the event's `:integration_meta` field, under: + +```elixir +event.integration_meta[:oban][:job] +``` + +You can use this for more complex filtering logic based on number of attempts and such. + See the documentation for event callbacks.