beto
Hello, I am working on an task, that requires to parse a csv sent from a react frontend. When the backend receives it, it should make an API call to a webservice. But now the csv is large and it’s not functional. My idea is to get the csv, answer the frontend and process the csv and API calls in the background, but I have no idea where to start. Can someone point on a tutorial or something on how to start? If there a way to avoid rabbitMQ redid would be better, if possible
Thank you very much
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 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
joaquinalcerro
Depending in your specific use case you can start simple with tasks:
task = Task.async(fn -> do_some_work() end)
res = do_some_other_work() res + Task.await(task)
santif
Looks like you need a background job processing library.
Take a look to rihanna which uses postgres as store for jobs.
Other solutions use redis: exq, verk, toniq.
que is backed by Mnesia.
More libs:
rjk
If you do it like this (without a job processing library, which is fine) keep the things in mind that are described in this article from Chris McCord Phoenix Tips and Tricks - DockYard under the title “Avoid Task.async if you don’t plan to task.await”. The summary is that if you want to use Task.async to process your CSV file, hook it into it’s own Task.Supervisor so that it is isolated from the controller.
dokuzbir
As @santif mentioned using a library better but if you wanna start quickly. You can start like that
kokolegorille
There are many ways to do this and You might find a different approach for each answer.
to start with communication.
Now You have a large choice with the pipeline, GenStage, Queue… or just a process.
The only thing async is the API call, all the rest could be transformed by simple functions.
For this call, I would use a simple Task, either supervised, or not.
Anyway You can leverage with any libraries mentionned, depending on the situation
joaquinalcerro
Here is another thread that might help @beto:
Best regards,
cnck1387
When I first came to Elixir, this was one of the biggest questions I had.
I think it would be really beneficial if there were a few blog posts and open source projects that went over a few production-ready solutions to handle cases like this. I think it would really help people using Elixir who are coming over from Rails or other stacks with the “web app + worker + redis” mentality.
Some of the use cases could be:
beto
Hello ! I appreciate your comments a lot, and I come to this solution, still not working, but I would love to see if I am on the right track:
dimitarvp
For starters, you have to pass a pointer to a function, not to invoke the function immediately and pass its result:
EDIT: As pointed out by @axelson, this is what would compile (also see the comment below mine):
axelson
Actually that won’t compile because you can’t use the shorthand anonymous function syntax (using
&) to define an anonymous function with 0 arguments. So you need to define the anonymous function with the explicit anonymous function syntax: