Follow

#Salesforce Development 

Today I had the most enjoyable 90 minutes of coding in a long time.

There's no limit on callouts per hour or day, but there are limits to async apex, so initiating callouts from triggers can hit limits.

At my last job, I created a queueable callout interface with dependency injection for different integrations. We never hit system limits but the solution was ready for improvement.

Today in under two hours I build a new, simpler, and better version from scratch in a sandbox for where I work now.

Last time I built this, I think finalizers weren't around for queueable . Now the service checks to see if there's more callouts beinge to send, and restarts itself to process the next batch.

Not many lines of code, but a powerful tool for . Queue the job on insert only if it isn't already running, it'll run until all callouts are handled.

That. Was. Fun. 😁

· · SubwayTooter · 0 · 0 · 1
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.