title: Callback methods in ASP.NET Web API
body: <p>I have an ASP.NET Web API server, that have to communicate with different applications on different platforms. And now I want to create a method that would be something like a callback: client application subscribes to it and waits until server fires a message.</p>
  <p><strong>Example:</strong>
  Many users are waiting until new product will be available in store - they subscribe to this &quot;event&quot;. When product arrives in store - every customer receives a message, which have to be handled in some case.</p>
  <ol>
  <li>Users send a request &quot;Subscribe&quot;</li>
  <li>Server receive a request &quot;Product available!&quot;</li>
  <li>Server sends every user a message with product details.</li>
  <li>User's application processes the message</li>
  </ol>
  <p>I tried to find some information about callbacks or duplex in ASP.NET Web API, but the one advice -  it's better to use WCF for this approach.</p>
  <h3>Solutions</h3>
  <ul>
  <li>In every client application create something like timer, that every N seconds sends a request &quot;Is product available?&quot; until gets &quot;false&quot;. When the response will be true - send a message &quot;Get product details&quot;. It's causes a lot of traffic and if there will be many clients with these timers - it would be something bad, isn't it?</li>
  <li>Create a small callbacks-server (maybe WCF). But in this case would be a lot of problems with communication between this server and apps on different platforms.</li>
  <li>Maybe there are some solution in ASP.NET Web API, that i missed.</li>
  </ul>
  <p>If you have some ideas how i can solve this problem, please give me an advice.</p>
  <p>Thanks for help.</p>