wolox / async-requests Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
When you run rails g async_request
it does not validate if the migration already exists and it creates a repeated one, which breaks the migrations.
We could add a JS that handles Exponential Backoff as an util.
In the endpoint that shows a job's status, the id should be compared using a comparison method that prevents a timing attack.
Currently, the async_request_jobs
table gets bigger and bigger with each async request. Since the client stops asking for a job once it is finished, it would be nice to have an automatic depuration in the table.
Another issue with the current behavior is that when you queue a job with a sensible parameter (like a password) it remains accessible for anyone that query the table.
I believe that this whole issue could be solved by performing a job destroy inside JobsController#show
--> render_finished_job(job)
Allow at least Rails 5.1
Currently the job path is /async_request/jobs/:id
, will be great to be able to configure that
There are a couple of problems with the README file:
async_request
but on the code example it does call for execute_async
.include AsyncRequest::ApplicationHelper
to my root controller.to_json
. A simple String does that and it doesn't work.status: 202
I would change that for status: :accepted
MyComputeHeavyWorker
and it says that uses Sidekiq to enqueue it, but actually MyComputeHeavyWorker
its just a simple class and not a sidekiq worker.We should schedule a task that deletes Jobs that are older than X days/hours. This value should be configurable
When you use async_requests for making requests that depend on an external service’s response, you maybe want to do something like this:
class MyWorker
def execute
response = HTTParty.get('http://some-url.com/some_resource')
[response.code, response.parsed_response]
end
end
Here, you can expect that if the response code is 200
, the response body will have data. But if the response code is 404
, maybe the body will be empty.
It would be nice if the library can handle this kind of scenario, and replace a nil
response with an empty hash {}
. This way, it prevents from returning an Internal Server Error
when the response body is empty.
Also, it would be nice if the README was corrected. In this case, a nil
response responds to to_json
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.