title: Show status of long process running on server side
body: <p>I'm working for CSV import in my Node.js based web app.
  Most given CSV files has tens of thousands of records, and it takes several minutes.</p>
  
  <p>So until import finish, I want to show users "Currently importing..." message.</p>
  
  <p>What I want to create is similar to Github's forking screen. After you press fork button on top right of repo, it shows message that "Forking / It should only take a few seconds." until fork finishes.
  In addition, I want to add progress bar to indicate percentage of processed records hopefully.</p>
  
  <p>Current my implementation is:</p>
  
  <ol>
  <li>Client send request with CSV data</li>
  <li>Server processes received CSVs and insert records to DB.</li>
  <li>Server respond 200 if CSV is valid.</li>
  </ol>
  
  <p>But with implementation users cannot see current status. Even sometimes socket hangs up.</p>
  
  <p>I'm considering following reimplementation:</p>
  
  <ol>
  <li>Client send request with CSV data</li>
  <li>Server respond 200 to tell client that CSV is received</li>
  <li>Server starts to process received CSVs and insert records to DB.</li>
  </ol>
  
  <p>However, I have no idea:</p>
  
  <ol>
  <li>how client know that import is done</li>
  <li>how client know when error is occur in CSV processing and DB insertion </li>
  </ol>
  
  <p>How can implement server side?
  Thanks in advance ;)</p>