title: How do I poll a service using RXJS Observables?
body: <p>Given the following code, how to I alter it to make the get request to "api/foobar" repeat every 500 milliseconds?</p>
  
  <pre><code>import {Observable} from "RxJS/Rx";
  import {Injectable} from "@angular/core";
  import {Http} from "@angular/http";
  
  @Injectable() export class ExampleService {
      constructor(private http: Http) { }
  
      getFooBars(onNext: (fooBars: FooBar[]) =&gt; void) {
          this.get("api/foobar")
              .map(response =&gt; &lt;FooBar[]&gt;reponse.json())
              .subscribe(onNext,
                     error =&gt; 
                     console.log("An error occurred when requesting api/foobar.", error));
      }
  }
  </code></pre>