Examples of Future


Examples of akka.dispatch.Future

        counter.tell("tick");
        counter.tell("tick");
        counter.tell("tick");

        Future future = ask(counter, "get", 5000);

        future.onSuccess(new OnSuccess<Integer>() {
            public void onSuccess(Integer count) {
                System.out.println("Count is " + count);
            }
        });
View Full Code Here

Examples of com.droidkit.actors.concurrency.Future

        if (message instanceof TypedRequest) {
            final TypedRequest req = (TypedRequest) message;
            try {
                if (req.getMethod().getReturnType().equals(Future.class)) {
                    try {
                        Future future = (Future) req.getMethod().invoke(this, req.getArgs());
                        if (future instanceof ResultFuture) {
                            req.getFuture().doComplete(future.get());
                        } else if (future instanceof TypedFuture) {
                            future.addListener(new FutureCallback() {
                                @Override
                                public void onResult(Object result) {
                                    req.getFuture().doComplete(result);
                                }
View Full Code Here

Examples of com.sun.corba.se.impl.orbutil.closure.Future

        return new Constant( value ) ;
    }

    public static Closure makeFuture( Closure value )
    {
        return new Future( value ) ;
    }
View Full Code Here

Examples of com.twitter.util.Future

    info("getting a whole row: " + cass.getRow("yay for me").apply());
    info("getting a column from a set of keys: " + cass.multigetColumn(Set("yay for me", "yay for you"), "name").apply());
    info("getting a set of columns from a set of keys: " + cass.multigetColumns(Set("yay for me", "yay for you"), Set("name", "motto")).apply());

    info("Iterating!");
    Future f = cass.rowsIteratee(2).foreach(new scala.runtime.AbstractFunction2<String, List<Column<String, String>>, scala.runtime.BoxedUnit>() {
      public scala.runtime.BoxedUnit apply(String key, List<Column<String,String>> columns) {
        info("Found: " + key);
        return null;
      }
    });

    f.apply();

    Future f2 = cass.columnsIteratee(2, "yay for me").foreach(new Function<Column<String, String>, scala.runtime.BoxedUnit>() {
      public scala.runtime.BoxedUnit apply(Column<String,String> column){
        info("Found Columns Iteratee: " + column);
        return null;
      }
    });

    f2.apply();

    info("removing a column");
    cass.removeColumn("yay for me", "motto").apply();

    info("removing a row");
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.Future

                    continue;
                }

                currentTask = task;

                Future future = executorService.submit( new Runnable()
                {
                    public void run()
                    {
                        try
                        {
View Full Code Here

Examples of hj.lang.Future

   
    // Interface with calls made from compiled code. No need to set data driven futures
    public void setDDF(Collection c) {}
   
    private void setup() {
        future = new Future();
        descendants = new Stack<FinishScope>();
        ID = Runtime.getUniqueActivityID();
        if (name.endsWith("$Main")) {
            // First activity (main) must set up a brand new finish scope
            scopeBelongsTo = new FinishScope();
View Full Code Here

Examples of hudson.remoting.Future

            TaskListener listener = hudsonLauncher.getListener();
            RemoteCall remoteCall = new RemoteCall(
                    Arrays.asList(cmd), env, in, out, null,
                    remotePath,
                    listener);
            Future future = channel.callAsync(remoteCall);
            currentProcess = new RemoteProc(future);

        } catch(IOException e) {
            //try to close all the pipes before throwing an exception
            closeBuffers();
View Full Code Here

Examples of io.netty.util.concurrent.Future

            RedissonCountDownLatchEntry newEntry = new RedissonCountDownLatchEntry(entry);
            newEntry.release();
            if (ENTRIES.replace(getEntryName(), entry, newEntry)) {
                if (newEntry.isFree()
                        && ENTRIES.remove(getEntryName(), newEntry)) {
                    Future future = connectionManager.unsubscribe(getChannelName());
                    future.awaitUninterruptibly();
                }
                return;
            }
        }
    }
View Full Code Here

Examples of io.vertx.core.Future

    return this;
  }

  @SuppressWarnings("unchecked")
  private void lookup(String name, Handler handler, int... types) {
    Future result = Future.future();
    result.setHandler(handler);
    lookup(name, result, types);
  }
View Full Code Here

Examples of java.util.concurrent.Future

    }


    @Test(dataProvider="createTimer")
    public void testTaskCancellationBeforeTaskHasRun(TimeScheduler timer) throws InterruptedException {
        Future future;
        StressTask task=new StressTask();
        try {
            future=timer.scheduleWithDynamicInterval(task);
            assert timer.size() == 1;
            future.cancel(true);
            assert timer.size() == 1;
            Util.sleep(200);
            int num_executions=task.getNumExecutions();
            System.out.println("number of task executions=" + num_executions);
            assert num_executions ==0 : "task should never have executed as it was cancelled before execution";
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.