Batch API processes next operation if existing operation is taking too much time I am using batch api for processing the operations.
In my operation I am sending xml request to different-different external server and waiting for its response, after getting its response I am processing it.

But sometimes it is taking too much time.
In case where it is taking too much time (If response is taking more than 2 minute). I want to process the next operation.

I checked batch_set but could found the way.
How to implement it?
I have achieved this using php.

Here is the sample code

$operations[] = array('batch_function_1');
$operations[] = array('batch_function_2');

$batch = array(
  'title' =&gt; t('Processing'),
  'operations' =&gt; $operations,
  'init_message' =&gt; t('Please wait processing is starting.....'),
  'progress_message' =&gt; t('Processed @current out of @total.'),
  'error_message' =&gt; t('Processing has encountered an error.'),
  'finished' =&gt; 'processing_finished',
);

batch_set($batch);


In case of soap I achieved using default_socket_timeout

function batch_function_1 () {
  ini_set("default_socket_timeout", $time);
  try{
    $client = new SoapClient($path_to_wsdl));
  }
  catch(Exception $e) {
    dpm('Timeout'); // echo 'Timeout';                                                                                                        
  }
}


And timeout when using exec.

function batch_function_2 () {
  // $command : Which needs to be executed for communicating with server.                                                                       
  exec("timeout {$time} {$command}", $output);
}


I also tried the set_time_limit which was not working with batch api.