Package org.agilewiki.jactor

Examples of org.agilewiki.jactor.MailboxFactory.createMailbox()


public class IteratorTest extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            It actor = new It();
            actor.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            System.out.println(SimpleRequest.req.send(future, actor));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
View Full Code Here


* Test code.
*/
public class Test5 extends TestCase {
    public void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor5a actor5a = new Actor5a();
        actor5a.initialize(mailbox);
        JAFuture future = new JAFuture();
        boolean response = Parallel.req.send(future, actor5a);
        assertEquals(true, response);
View Full Code Here

public class SetFTest extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            SetF1 actor = new SetF1();
            actor.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            System.out.println(SimpleRequest.req.send(future, actor));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
View Full Code Here

public class CallTest extends TestCase {
    public void test() {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        try {
            Call actor = new Call();
            actor.initialize(mailboxFactory.createMailbox());
            JAFuture future = new JAFuture();
            System.out.println(SimpleRequest.req.send(future, actor));
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
View Full Code Here

* Test code.
*/
public class Test2a extends TestCase {
    public void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor1 actor1 = new Actor1();
        actor1.initialize(mailbox);
        Actor2 actor2 = new Actor2();
        actor2.initialize(mailbox, actor1);
        JAFuture future = new JAFuture();
View Full Code Here

* Test code.
*/
public class Test1 extends TestCase {
    public void test() throws Exception {
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Actor1 actor1 = new Actor1();
        actor1.initialize(mailbox);
        JAFuture future = new JAFuture();
        String result = Hi1.req.send(future, actor1);
        assertEquals("Hello world!", result);
View Full Code Here

        //int s = 10000;
        //mps = 19857029


        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
        Mailbox mailbox = mailboxFactory.createMailbox();
        Driver driver = new Driver();
        driver.initialize(mailbox);
        driver.r = r;
        driver.s = s;
        JAFuture future = new JAFuture();
View Full Code Here

        //[java-shared] Count: 100000000000
        //[java-shared] Test time in seconds: 10.457
        //[java-shared] Messages per second: 9.562972171750979E7
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {
            Mailbox sharedMailbox = mailboxFactory.createMailbox();
            CounterActor counterActor = new CounterActor();
            counterActor.initialize(sharedMailbox);
            Driver driver = new Driver();
            driver.initialize(sharedMailbox, counterActor, runs);
            JAFuture future = new JAFuture();
View Full Code Here

        //[java-unshared] Test time in seconds: 52.955
        //[java-unshared] Messages per second: 1.8883958077613067E7
        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {
            CounterActor counterActor = new CounterActor();
            counterActor.initialize(mailboxFactory.createMailbox());
            Driver driver = new Driver();
            driver.initialize(mailboxFactory.createMailbox(), counterActor, runs);
            JAFuture future = new JAFuture();
            long start = System.currentTimeMillis();
            Long count = (Long) SimpleRequest.req.send(future, driver);
View Full Code Here

        MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(10);
        try {
            CounterActor counterActor = new CounterActor();
            counterActor.initialize(mailboxFactory.createMailbox());
            Driver driver = new Driver();
            driver.initialize(mailboxFactory.createMailbox(), counterActor, runs);
            JAFuture future = new JAFuture();
            long start = System.currentTimeMillis();
            Long count = (Long) SimpleRequest.req.send(future, driver);
            long finish = System.currentTimeMillis();
            double elapsedTime = (finish - start) / 1000.;
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.