Package kilim

Examples of kilim.Task$ArgState


  /**
   * @param job
   */
  public static void run_async(final EAsync job, final EDriverTask dt) {
    run_async(new Task() {
      @Override
      public void execute() throws Pausable, Exception {
        job.async();
        dt.async_done(job);
      }
View Full Code Here


  }

  @Override
  public Task start() {
    Task result = super.start();
    this.pstate = STATE.RUNNING;
    return result;
  }
View Full Code Here

   
    if (pid != null) {
      pid.remove_exit_hook(this);
    }

    ERT.scheduler.schedule( new Task() {
      @Override
      public void execute() throws Pausable, Exception {
        on_timeout();
      }
    } );
View Full Code Here

import kilim.Task;
import kilim.test.ex.ExInterfaceGenericTask;

public class TestInterface extends TestCase {
    public void testIntCall() throws Exception {
        Task task = new kilim.test.ex.ExInterfaceImpl();
        Mailbox<ExitMsg> exitmb = new Mailbox<ExitMsg>();
        Scheduler s = new Scheduler(1);
        task.informOnExit(exitmb);
        task.setScheduler(s);
        task.start();
       
        ExitMsg m = exitmb.getb();
        if (m == null) {
            fail("Timed Out");
        } else {
View Full Code Here

   
    public static void main(String args[]) throws Exception {
        Stopwatch s = new Stopwatch();
        s.tick();

        Task t = new Jetlang().start();
        new Publisher().start();
        t.joinb(); // wait for receiver to finish
       
        s.tickPrint(max+1); // same number of iterations as jetlang's tests.
    }
View Full Code Here

     */
    public NioSelectorScheduler() throws IOException {
        this.sel = Selector.open();
        selectorThread = new SelectorThread(this);
        selectorThread.start();
        Task t = new RegistrationTask(registrationMbx, sel);
        t.setScheduler(this);
        t.start();
    }
View Full Code Here

                        sk.interestOps(0);
                        if (o instanceof SockEvent) {
                            SockEvent ev = (SockEvent) o;
                            ev.replyTo.putnb(ev);
                        } else if (o instanceof Task) {
                            Task t = (Task) o;
                            t.resume();
                        }
                    }
                }
                runnables.reset();
                runnables = _scheduler.swapRunnables(runnables);
                // Now execute all runnables inline
                // if (runnables.size() == 0) {
                // System.out.println("IDLE");
                // }
                while (runnables.size() > 0) {
                    Task t = runnables.get();
                    t._runExecute(null);
                    // If task calls Task.yield, it would have added itself to scheduler already.
                    // If task's pauseReason is YieldToSelector, then nothing more to do.
                    // Task should be registered for the appropriate Selector op.
                    // In all other cases, (Task.sleep(), Mailbox.get() etc.), unregister
                    // the channel
View Full Code Here

import kilim.Scheduler;
import kilim.Task;

public class TestInterface extends TestCase {
    public void testIntCall() throws Exception {
        Task task = new kilim.test.ex.ExInterfaceImpl();
        Mailbox<ExitMsg> exitmb = new Mailbox<ExitMsg>();
        Scheduler s = new Scheduler(1);
        task.informOnExit(exitmb);
        task.setScheduler(s);
        task.start();
       
        ExitMsg m = exitmb.getb();
        if (m == null) {
            fail("Timed Out");
        } else {
View Full Code Here

public class TestLock extends TestCase{
    public void testLocks() {
        Scheduler scheduler = new Scheduler(4);
        Mailbox<ExitMsg> mb = new Mailbox<ExitMsg>();
        for (int i = 0; i < 100; i++) {
            Task t = new LockTask();
            t.informOnExit(mb);
            t.setScheduler(scheduler);
            t.start();
        }
        boolean ok = true;
        for (int i = 0; i < 100; i++) {
            ExitMsg em = mb.getb(5000);
            assertNotNull("Timed out. #tasks finished = " + i + "/100", em);
View Full Code Here

   
    public static void main(String args[]) throws Exception {
        Stopwatch s = new Stopwatch();
        s.tick();

        Task t = new Jetlang().start();
        new Publisher().start();
        t.joinb(); // wait for receiver to finish
       
        s.tickPrint(max+1); // same number of iterations as jetlang's tests.
    }
View Full Code Here

TOP

Related Classes of kilim.Task$ArgState

Copyright © 2018 www.massapicom. 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.