Is there anyway to get a result from process function(Oban Pro)?

  def after_process(state, %Job{})
    if state == :complpete do
      MyApp.broadcast(
        topic,
        {:success, some_data}
      )
    else
      MyApp.broadcast(
        topic,
      {:fail, _some_data}
      )
    end
  end

As the title suggests, I’m using the after_process function to inform a client about the request’s progress. However, I need to pass along additional data, specifically the result from process function, represented as {:ok, result}. Is there a way to achieve this?

Hey! I think if you return the value you want to send from the process function itself then in after_process you can get it from job.result.

That is what I thought so I looked up the doc here. But I couldn’t find result.

I will try what you suggested.
Thanks

Apologies I was going off of memory. On my computer now, I’d check out the docs here Oban.Pro.Worker — Oban Pro v1.2.1.

2 Likes