Django Celery One request splitting in multiple tasks [closed] - json

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am looking to achieve something like this:
To have one input json request, which will encapsulate what to do than:
split that input into 3 or more sub-requests depending on json, like put in database
an agent will wake up since he is processing one part of that request, like putting data to some server
another agent will woke up since the request is for him too, he will like upload data to some other server
meanwhile another request could do state information about request whats part did executed and finished
Is Django + Celery good for this ?
Main goal is to with one request serve parts independently, so like when processing request when waiting for the server in one part of request will not ommiting other part of request which will be processed without any lag.

If your json contains all sub-requests and can be handled asynchronously, seems like this is a job for RxJava which can handle event based programs using observable sequences. Best to read the docs first to see if they fit your use case.

Related

Can I use POST instead of PUT in a NodeJS app? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 25 days ago.
The community reviewed whether to reopen this question 25 days ago and left it closed:
Original close reason(s) were not resolved
Improve this question
What is the difference if I always use POST method to update a row in the MySQL or Cassandra database instead of PUT?
I ask this because when I did research on that I read in some other questions that were saying POST request causes multiple instances creation. I wanted to make sure if is that correct?
The database doesn't care about how the server talks to clients.
Technically you could use POST for everything. That's basically how GraphQL works. But doing that means your API is not RESTful.
These are the basic RESTful API methods:
Method
Description
GET
Retrieve information about the REST API resource
POST
Create a REST API resource
PUT
Update a REST API resource
DELETE
Delete a REST API resource or related component
That being said, if you feel like your use-case works and reads better with just POST or GET, go for it.
Neither mysql nor Cassandra will even be aware if the client made a http put or post request, so from a database point of view it is totally irrelevant which http request type you use.

How to make sure to get data from api in swift [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 10 months ago.
Improve this question
I try to fetch some data from api and store the data in a userdefault, then in another func to use the value in the userdefault. But sometimes when I try to get the value in the userdefault, it has not been fetched from api because of the poor internet, so how can I make sure I can get the data before I execute the second func.
Or do you have any solutions?
Thank you guys
There can always be conditions where you can fail a fetch. When you are executing your function that uses the data you were fetching you can first make sure there is any data at all, before manipulating it.
For slow internet specifically, you can check "retries" and retry mechanisms: example
One more thing, UserDefaults shouldn't be used for storing large data, it's typically used for storing some user preferences like colors, fonts, etc. (It's not encrypted - unsafe)

How does Google give so fast suggestions? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
So I was debugging the google search using chrome dev tools and I found out that each time I modify the contents of the search bar, it makes a network call. That itself was baffling for me because this means each search generates around 10 or more server calls for google! Even more surprising is the fact that even then google manages to return suggestions so fast. How do they do it?
One more doubt would be how they handle concurrent ajax calls? (assuming they are ajax calls ofcourse). Like if my search does 10 ajax calls to the server and the latest ajax call returns results faster than the second last ajax call then in that case the response from the second last ajax call would be shown on the UI instead of the latest call right?
They have servers that can upload/download and retrieve upwards of 10 GB/s so that is why!
Happy Coding!

iOS - Download json swift [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Good day.
I was faced with the task, can not find the answers on the internet, can anyone be able to help.
I need to send a request to the service. This request must be sent no more than 1 second once per hour. From the answer to the query to extract part of the data. When you receive or availability of this information, it should be added to the text box. Data should be stored and re-used after restarting the application.
To connect to the service, I use Alamofire. Help please, whether there is in this library any function to set the time limit, I request? And how to save the data? Save the new json file locally, or the data stored in an array, or use the database?
Thank you for your help.
I don't have an idea of setting a time limit, but you can explore the NSTimer function to check for that and if it is just a string that you want to store, you only need to use NSUserDefaults for that. It stores your data as a property list and you can access it from anywhere in the app at anytime.
Here's a link to help you setup NSUserDefaults.

What are the steps when an HTML form is submitted using POST method? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
What are the underlying steps of data transmission when a user submits a HTML form using POST method ?
I searched for the answer but mostly it's been talked about the difference between the POST method and the GET method and where to use them.
The simple answer is that all the data of the form is encoded into byte array and put within the message body of a HTTP request. But, it's too general. I'd like to know the specific steps.
Ignoring what the server decides to do with the data, no, not really.
The format of the encoded data is determined by the content-type specified in the form tag, and defaults to pretty much the same as what would be after the "?" in the URL that would've been build if you used method="GET" (see the W3 spec)
The specific steps that are made are related to sending an HTTP request, not to the method which is used (GET/POST/PUT/DELETE/OPTIONS/HEAD).
There are differences between POST and GET - but those differences are mainly due to conventions: Let's take REST web-services for example, GET is used (by convention) to get a resource, while POST is used to CREATE a resource and PUT - to modify an existing one.
There are also some limitation differences, but again - these limitation exist due to implementations, for example:
IE can hold only 2048 characters in the URL, Tomcat Apache supports up to 4000 characters - so GET requests which are made from a browser are limited, while POST request aren't.