devie
Please i’ve got a Question, i’m replacing a Predictive dialer with Elixir. It has exceeded all expectations so far. However, i’m facing an issue. This piece of code works well assuming all third party dependencies work as expected,
def perform(phonebook_contacts,...) do
alias FSModEvent.Connection, as: C
for x <-Enum.chunk(phonebook_contacts,100,100,[]), y <- x do
unless Telephony.user_balance(account_number) <= 0 do
Task.start_link(fn ->
# some background job to dailout phone number y
end)
# :timer.sleep(1000);
end
...
phonebook_contacts can be a list with as many as 200K Numbers
I’m using exq. If something external causes the job to fail, when it gets retried, it starts from the begining of the list, is there a way i can probably retry from the last contact where the Job failed at?
Assuming [12,34,56,78,90…]
Assuming the Job fails at 56, it restarts from 12 again, it there a way of continuing from 78,...? or a better way of handling this use case?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mbuhot
If you are already using Exq, then maybe store the progress of the job in redis?
devie
Thank you for your suggestion. Any pointers on how to do this? While i dig through the Exq documentation
Architect
Interesting. Can you please share more about your project?
devie
@Architect It’s part of a cloud based Call Center application - Inbound,outbound,voice analytics, IVR, … This code snippet just handles the dialing of the outbound calls.
Eiji
@devie: How about use retry library?
To save state you can use simple
Agentand then skip entries based on stored information in it.ryh
I don’t really know much about Exq, but looking at it… it doesn’t seem well-suited for what you’re trying to do. You’re redefining what Exq means by “retry”, which is “do this again with the same arguments as before as I’m expecting the same result”.
As for your idea of retry – you want to be able to start where the failure happened because starting from the beginning won’t give the same result - it has side effects! Even though you’re restarting what you think is the same job, with Exq semantics, that’s actually a new job because you want to use a different set of data.
I think there’s a better way to do this…
But first, what constitutes a failure? Is it when you receive a BGAPI error or a FreeSWITCH -ERR response or what?
Second, do you really want to start from the first job that failed? It makes more sense to me to collect every dial out that failed and then retry those specifically.
cjbottaro
Or use the retryable_ex package which doesn’t use a single drop of metaprogramming or macros.
Or just use Faktory (by the author of Sidekiq) and the Elixir Faktory Client, which has retries built in.
devinit
I have the same problem, how did you answer?