Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6868297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:25:00+00:00 2026-05-27T03:25:00+00:00

We have a REST service that calls out to a system process that could

  • 0

We have a REST service that calls out to a system process that could possibly take upwards of 2 minutes to process. Since on clients I don’t want to wait 30-seconds to 2 minutes for a response back from the server, can I return a 202 to the client to notify that it’s in processing but doesn’t necessarily need to wait for the process to finish?

Is there a safe way to handle this? (I’m sure there is thread safety issues here, especially if the service could get hit with tons of requests at once, so creating tons of threads may not be the solution.)

Something we are exploring is using batch processing that checks every 5 minutes or so to check the db for reports that need generating (which is what the system process is for), but I was curious about this possibility.

Thanks in advance

EDIT
The final product is actually a PDF report that gets generated, and then emailed to the user. I am mostly trying to get around having to wait the ~2 minutes of waiting for the service response back on the consuming client.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:25:00+00:00Added an answer on May 27, 2026 at 3:25 am

    I think the immediate return of a 202 from the service is fine as it’s acknowledging the successful receipt of the request to create a pdf.

    Your plan to log pending requests in the db and process them in batches makes sense to me. If each pdf file is ticked off as ‘done’ once the pdf has been sent without error (like a message queue / worker role system) I think it will work fine.

    If you didn’t want to go the db route your service endpoint could spawn another async job then return a 202. That way the pdf job is started immediately and the client gets an immediate response – but this does seem a bit messy IMO.

    edit: re-reading your question – I don’t think you can return the 202 and keep on processing within the same function. Once you have returned, that’s it (unless you spawned another async job, as above).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that calls a rest service and gets back a string
I have a web service class that the rest of the framework depends on
I have a REST service that's reasonably complete and will be used with an
I have an application that uses AsyncTasks to make REST calls to a server.
I have made a REST Web service, that works with Visual Studios WCF Test
I have constructed a simple Rest service using ServiceStack (which is brilliant), that returns
I have a Jersey client that is successfully calling a REST service and populating
I have a REST service consumed by a .Net WCF client. When an error
I have a REST data service where I want to allow the users to
am new to Json so a little green. I have a Rest Based Service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.