code: public static void example2(String... args)  {
  
          /* Synchronous service. */
          final TodoManager todoManagerImpl = new TodoManager();
  
          /*
          Create the service which manages async calls to todoManagerImpl.
  
          You can control the batch size of methods.
          After it hits so many, it sends those methods to the service.
          This allows threads to handle many method calls with on access of the queue.
          Here we set it to 1 so it will flush with every call.
          Setting invoke dynamic false turns off auto type conversion which is mainly for JSON REST calls
          and WebSocket calls.
          This means that you can execute the service more efficiently when it is in proc.
           */
          final ServiceQueue serviceQueue = serviceBuilder()
                  .setRequestQueueBuilder(queueBuilder().setBatchSize(1))
                  .setServiceObject(todoManagerImpl).setInvokeDynamic(false)
                  .build().startServiceQueue();
  
  
          /* Create Asynchronous proxy over Synchronous service. */
          final TodoManagerClientInterface todoManager = serviceQueue.createProxy(TodoManagerClientInterface.class);
  
          serviceQueue.startCallBackHandler();
  
  
          System.out.println("This is an async call");
          /* Asynchronous method call. */
          todoManager.add(new Todo("Call Mom", "Give Mom a call"));
  
  
          AtomicInteger countTracker = new AtomicInteger(); //Hold count from async call to service
  
          System.out.println("This is an async call to count");
  
          todoManager.count(count -> {
              System.out.println("This lambda expression is the callbackWithTimeout " + count);
  
              countTracker.set(count);
          });
  
  
          /*
          We don't need this now.
           */
          //todoManager.clientProxyFlush(); //Flush all methods. It batches calls.
  
          Sys.sleep(100);
  
          System.out.printf("This is the count back from the service %d\n", countTracker.get());
  
          todoManager.list(todos -> todos.forEach(System.out::println));
  
      }
docs: You can use services in process