Question: this is the iposts interface I am using 

```
export interface IPosts
{
        albumId: number,
        id: number,
        title: string,
        url: string,
        thumbnailUrl: string
}

```

this is the function call i am making to the service 

```
  ngOnInit() {

this.route.paramMap.subscribe((params : ParamMap) =>
{
  let id = parseInt(params.get('id'));
  this.ProductId = id;

  this.PostService.getPostsByParam(id).subscribe(data => this.States = data);

});

```

this is the url i am requesting to 

```
private _url = 'https://jsonplaceholder.typicode.com/photos';

```

this is my request function which is getting the id and i want to request on based of id as param 

```
getPostsByParam(id:number):Observable<IPosts[]>
  {
    let params1 =  new HttpParams().set("id",'id');
    return this.http.get<IPosts[]>(this._url,{params:params1});
  }

```

this is the html code 

```
<div class="row">
        <div *ngFor="let state of States" class="card col-lg-2"  style="width: 18rem; ">

             <img class="card-img-top" src="{{state.url}}" alt="Card image cap">
            <div class="card-body">
              <p class="card-text">{{state.title}}</p>
            </div>
        </div>
          <br/>
    </div>

```

Answer: 
This is a great and easy way to multi thread :)

```
import threading
from threading import Thread

# Adding in definition provides more reliability :)
def example_request():
  while True:
     try:
       requests.get("www.bing.com")
     except:
       print("Error...")

# Threading phase
for _ in range(5):
  Thread(target=example_request).start()

```

This example is way more simpler, has thread exception catcher and is pretty fast and reliable. For more speed just increase the range length ;)
```
class InformantThread(Thread):
  """Informant thread can report or inform the caller thread regarding any exception in the call stack of the spawned thread by
     saving the exception and re raise it in join section. this is the best way for notifying the caller regarding exceptions during
     target executing.
  """
  def __init__(self, *args, **kwargs):
    super(InformantThread, self).__init__(*args, **kwargs)
    self.exc = None

  def run(self):
    try:
      if hasattr(self, '_Thread__target'):
        # Thread uses name mangling in python 2.
        self.ret = self._Thread__target(*self._Thread__args, **self._Thread__kwargs)
      else:
        # for python 3
        self.ret = self._target(*self._args, **self._kwargs)
    except (BaseException, Exception) as e:
      self.exc = e

  def join(self, timeout=None):
    super(InformantThread, self).join(timeout)
    if self.exc:
      raise self.exc

def foo():
    while(True):
        print 'Hello World!'
        time.sleep(1)

```

Caling My InformantThread for executing foo():

```
  i_thread = InformantThread(target=foo)
  ## If we dispatch it as normal thread (not daemon), at time out it will prevent main thread
  # (calling thread) to exit !! hence the declaration as daemon.
  i_thread.daemon=True
  i_thread.start()
  i_thread.join(float(60)) #60 seconds time out
  if i_thread .is_alive():
    raise Exception("Timeout has expired")

```