public static Runnable createRunLoop(scala.collection.immutable.Map<TaskName, RunLoopTask> taskInstances,
      SystemConsumers consumerMultiplexer,
      ExecutorService threadPool,
      SamzaContainerMetrics containerMetrics,
      HighResolutionClock clock,
      Config config) {

    log.info("Run loop in asynchronous mode.");

    return new RunLoop(
      JavaConverters.mapAsJavaMapConverter(taskInstances).asJava(),
      threadPool,
      consumerMultiplexer,
      containerMetrics,
      clock,
      new RunLoopConfig(config));
  }
Factory class to create runloop for a Samza task, based on the type
of the task
samza-core/src/main/java/org/apache/samza/container/RunLoopFactory.java