Question: I am facing a problem, which, I am sure, lot of others must have faced already.  

How to handle literals in Templates ?  

Please refer my code:

```
template<typename T, typename U>
static void Swap( T& a, U& b )
{
        T temp;
        temp = a;
        a    = (T) b;
        b    = temp;
}

int main()
{
   int i = 10, j = 20;
   //! Working
   Swap<int,int>(i,j);

   int p = 50; double q = 100.0;
   //! Working
   Swap<int,double>(p,q);

  //How to handle this case ?
   Swap<int,int>(5,10);

   return 0;
}

```

Answer: 
PHP's exec function will always wait for a response from your execution. However you can send the stdout & stderror of the process to /dev/null (on unix) and have these all the scripts executed almost instantly. This can be done by adding..

```
 '> /dev/null 2>&1 &'

```

To the end of your execution string.

But! that means they'll fork off and finish processing independently. It may be worth having them write a response back somewhere. And you could create a listener to pick this up and process it.
Look at ExecFuture andFutureIterator in the libputil library: 

<https://secure.phabricator.com/book/libphutil/class/ExecFuture/>

It does exactly what you need with a pretty nice syntax:

```
$futures = array();
foreach ($files as $file) {
  $futures[$file] = new ExecFuture("gzip %s", $file);
}
foreach (new FutureIterator($futures) as $file => $future) {
  list($err, $stdout, $stderr) = $future->resolve();
  if (!$err) {
    echo "Compressed {$file}...\n";
  } else {
    echo "Failed to compress {$file}!\n";
  }
}

```