Reputation: 2907
I'm going to write a simple REST webservice for downloading files from server( a simple GET method) The question is: Do I have to handle concurrency in this situation or the web server is going to do that?
Upvotes: 3
Views: 1453
Reputation: 13682
It depends on what you mean by "handle concurrency". Do you have to write code to spawn threads on each incoming request? No, Jersey will create a new thread for each request before it calls your API method. Do you need to worry about a DELETE
request coming in when somebody else is GET
ing a file? Yup.
Upvotes: 2
Reputation: 4767
Hmm, bit of a vague question but:
Upvotes: 2
Reputation: 1333
If yo're using only method-local variables, concurency is not an issue (container handles this).
Upvotes: 1