Examples of submit()


Examples of io.netty.util.concurrent.EventExecutorGroup.submit()

                // timer for the total serialization time
                final StopWatch stopWatch = new StopWatch();

                final EventExecutorGroup executorService = ctx.executor();
                final Future<?> iteration = executorService.submit((Callable<Void>) () -> {
                    logger.debug("Preparing to iterate results from - {} - in thread [{}]", requestMessage, Thread.currentThread().getName());

                    stopWatch.start();

                    List<Object> aggregate = new ArrayList<>(resultIterationBatchSize);
View Full Code Here

Examples of java.util.concurrent.CompletionService.submit()

            int count = 0;
            debug("Number of execution threads: %s", nThreads);

            try {
                for (final String file : listSelectedFiles()) {
                    completionService.submit(new Runnable() {
                        public void run() {
                            Document document = documentFactory.createDocuments(file);
                            debug("Selected file: %s [header style: %s]", document.getFile(), document.getHeaderDefinition());
                            if (document.isNotSupported()) {
                                warn("Unknown file extension: %s", document.getFile());
View Full Code Here

Examples of java.util.concurrent.ExecutorCompletionService.submit()

            // Execute collection asynchronously (TODO: cache pool usage could be
            // improved)
            final ExecutorService cachePool = Executors.newCachedThreadPool();
            final ExecutorCompletionService<String> ecs = new ExecutorCompletionService(cachePool);
            final Future<String> future = ecs.submit(new Callable<String>() {

                public String call() throws Exception {
                    return AccessController.doPrivileged(new PrivilegedAction<String>() {
                        public String run() {
                            return newClient.toString();
View Full Code Here

Examples of java.util.concurrent.ExecutorService.submit()

        final ExecutorService exec = Executors.newFixedThreadPool(threads);
        try {
            for(int i = 0; i < threads; i++) {
                final int threadId = i;
                exec.submit(new Runnable() {
                    public void run() {
                        try {
                            if(lock == null) {
                                runBenchmarkWithZipfDistributionLongHashSync(pager, hash, capacity, round, percent, scanLength, dist[threadId]);
                            } else {
View Full Code Here

Examples of java.util.concurrent.ForkJoinPool.submit()

public class FjPhaser {

  public static void main(String[] args) throws InterruptedException {
    final Phaser barrier = new Phaser(2);
    final ForkJoinPool pool = new ForkJoinPool();
    ForkJoinTask<?> t1 = pool.submit(ForkJoinTask.adapt(new Runnable() { // T1
      @Override
      public void run() {
        JArmus.register(barrier); // Is using the latch
        try {
          ForkJoinTask.adapt(new Runnable() { // T2
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.submit()

        }
        return true;
      }
    };
    ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
    Future<Boolean> submit = executor.submit(runnable);
    int count = 0;
    while (count < 10)
    {
      try
      {
View Full Code Here

Examples of java.util.concurrent.ScheduledThreadPoolExecutor.submit()

            instrumenter.open(instrumenterFile, true);
            List<Future<File>> futures = new ArrayList<Future<File>>();
            for (File file: srcPaths) {
                String path = file.getPath();
                if (path.matches(".*/ofbiz[^/]*\\.(jar|zip)")) {
                    futures.add(executor.submit(new FileInstrumenter(instrumenter, file)));
                } else {
                    futures.add(new ConstantFutureFile(file));
                }
            }
            List<File> result = new ArrayList<File>(futures.size());
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor.submit()

     // Split each store file.
    for (StoreFile sf: hstoreFilesToSplit) {
      //splitStoreFile(sf, splitdir);
      StoreFileSplitter sfs = new StoreFileSplitter(sf, splitdir);
      futures.add(threadPool.submit(sfs));
    }
    // Shutdown the pool
    threadPool.shutdown();

    // Wait for all the tasks to finish
View Full Code Here

Examples of javax.enterprise.concurrent.ManagedExecutorService.submit()

               
                ManagedExecutorService executor = (ManagedExecutorService) ctx.lookup("java:comp/env/concurrent/myExecutor2");
//                ManagedExecutorService executor = (ManagedExecutorService) ctx.lookup("java:comp/DefaultManagedExecutorService");
                for (int i = 0; i < 5; i++) {
                    out.format("submitting runnable(%d)<br>", i);
                    executor.submit(new MyRunnableTask(i));
                    out.format("submitting callable(%d)<br>", i);
                    executor.submit(new MyCallableTask(i));
                }
            } catch (NamingException ex) {
                Logger.getAnonymousLogger().log(Level.SEVERE, null, ex);
View Full Code Here

Examples of javax.ws.rs.client.Invocation.submit()

            final Invocation build = "PUT".equals(method) ? request.build(method, Entity.entity("",
                    MediaType.TEXT_PLAIN_TYPE)) : request.build(method);

            try {
                build.submit(responseType);
                fail("IllegalArgumentException expected.");
            } catch (final IllegalArgumentException iae) {
                // OK.
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.