title: Executor Service with void return type
body: <p>Here I want to call <code>n</code> threads and execute my function <code>padrDao.saveGuidanceDetails(sgd)</code> which is a DAO method performing insert operation and return a long value as shown in below code. </p>
  
  <p>Im using Callable, but it asks me to return some value but I'm not familiar with threads to use <code>Runnable</code> for the same job. Can someone pls validate if code is right or any modifications to be done? I feel code is wrong since there is a return statement inside callable and that will take me outside the main method for the first task itself.</p>
  
  <pre><code>int totalThreadsNeeded=listForguidanceItems.size();     
  ExecutorService executor = Executors.newFixedThreadPool(totalThreadsNeeded);
  List&lt;Callable&lt;Void&gt;&gt; runnableTasks = new ArrayList&lt;&gt;();
  final PriceLineItemsResultExt response1=response;
  
  for(final ProductLineItemResultExt item: listForguidanceItems)
  {
      int counter=0;
      final SavedGuidanceDetailsDto sgd=list.get(counter);
  
      Callable&lt;Void&gt; task1 = new Callable() {
          public Void call() {
              if (sgd.hasGuidance())
              {
                  if (response1.isSaveGuidance()) {
                      long guidanceDetailsId = padrDao.saveGuidanceDetails(sgd);
                      item.setGuidanceDetailsId(String.valueOf(guidanceDetailsId));
              } 
          }
  
          return null;
      }};
  
      counter++;
      runnableTasks.add(task1);
  }
  
  try {
      executor.invokeAll(runnableTasks);
  } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      logger.info("Thread fail exception  " + e);
  }
  
  executor.shutdown();
  </code></pre>
  
  <p>Pls suggest me modifications with the right code? Thanks in advance </p>