Working on an app with Oban Pro… I confess it’s a bit disorienting to navigate the docs for this because the pro stuff isn’t in the regular hexdocs (Oban — Oban v2.17.11); they’re in Overview — Oban Pro v1.4.10 and the version numbers seem inaccurate
But that aside…
Where is the process/1 function defined? Our workers use Oban.Pro.Workers.Workflow, but inside that module there is no process/1 function or callback defined that I can find (see Oban.Pro.Workers.Workflow — Oban Pro v1.4.10). Examples are all over the docs page showing code snippets implementing that function, but if I look only at the source code, I might not realize that that is a valid function… I can’t seem to find its spec. Can someone point me to where this is documented? (And hopefully get a link or something added to the official docs?).
The Pro package is entirely separate from Oban itself. We used to colocate Pro guides with the regular hexdocs, but it was impossible to display module docs with types, functions, etc. Since then Pro, Web, and Met have their own dedicated docs with guides and module docs.
All of the Pro module docs are available through the MODULES sidebar navigation where they’re organized into engines, extensions, plugins, and workers.
The perform/1 callback is defined in the OSS Oban.Worker. All Pro workers use process/1 instead, as defined in Oban.Pro.Worker. There’s a section about migrating to process/1 in the Adoption Guide.
Thank you @sorentwo – I confess I did a classic screw-up and I mislabled the focus of my OP – I was looking for process/1 (not perform/1 – I find the distinction confusing). I’ve updated the title of the post.
I think it would be helpful if the docs for Oban.Pro.Workers.Workflow — Oban Pro v1.4.10 were updated to include a proper link. There is only 1 mention of process/1, but it is not linked, so one would not know that it was defined in Oban.Pro.Worker. Hopefully that’s an easy fix.
It is a little confusing, and ideally there wouldn’t be any difference, but it’s there for extensibility. It’s one of the drawbacks of no-monkey-patching, but keeps us honest
We’ll do you one better. In Pro v1.5+, workflows will Just Work™ with Oban.Pro.Worker and you don’t need a dedicated worker at all.
One more thing I remembered while working on docs today—they’re searchable. Click the search bar or press / from anywhere on the page to enable the search bar. From there, type process and it brings up the callback as the first result:
That’s because it’s only defined for Oban.Pro.Workerin the oban_pro docs, not the oban hexdocs. Sorry, as configurable as ex_doc is, the docs can’t be colocated.