title: How to prevent concurrency in web service API?
body: <p>We have three web services (<code>/a</code>, <code>/b</code>, <code>/c</code>) where each service maps to a method (<code>go()</code>) in a separate Java class (<code>ClassA</code>, <code>ClassB</code>, <code>ClassC</code>).</p>
  
  <p>Only one service should run at the same time (ie: <code>/b</code> cannot run while <code>/a</code> is running).  However as this is a REST API there is nothing to prevent clients from requesting the services run concurrently.  </p>
  
  <p>What is the best and most simple method on the server to <em>enforce</em> that the services <em>don't</em> run concurrently?</p>
  
  <hr>
  
  <p><strong>Update</strong>: This is an internal app, we will not have a large load and will just have a single app server.</p>
  
  <p><strong>Update</strong>: This is a subjective question as you can make different arguments on the general application design which affects the final answer.  Accepted overthink's answer as I found that most interesting and helpful.</p>