Examples of DefaultPGroup


Examples of groovyx.gpars.group.DefaultPGroup

    public int totalMessages() {
        return repeat;
    }

    public long timeThroughput(final int reps, final int numberOfClients) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException, InterruptedException {
        group = new DefaultPGroup(new FJPool(maxClients));
        repeatsPerClient = repeat / numberOfClients;//MESSAGE quota for each pair of actors

        long totalTime = 0L;
        for (int i = 0; i < reps; i++) {
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

    }

    private void setupLatencyBenchmark(final int numberOfClients) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {

        totalDuration = 0L;
        group = new DefaultPGroup(new FJPool(maxClients));
        latch = new CountDownLatch(numberOfClients);
        repeatsPerClient = repeat / numberOfClients;
        clients = new ArrayList<Actor>();

        for (int i = 0; i < numberOfClients; i++) {
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

    @Test
    public void testDataflowVariable() throws Throwable {
        final List<String> logMessages = new ArrayList<String>();

        final DefaultPGroup group = new DefaultPGroup(10);

        // variable can be assigned once only, read allowed multiple times
        final DataflowVariable<Integer> a = new DataflowVariable<Integer>();

        // group.task will use thread from pool and uses it to execute value bind
        group.task(new Runnable() {
            public void run() {
                // first thread binding value succeeds, other attempts would fail with IllegalStateException
                logMessages.add("Value bound");
                a.bind(10);
            }
        });

        // group.task will use thread from pool and uses it to execute call method
        final Promise<?> result = group.task(new Callable() {
            public Object call() throws Exception {
                // getVal will wait for the value to be assigned
                final int result = a.getVal() + 10;
                logMessages.add("Value calculated");
                return result;
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

    public Pipeline(final DataflowReadChannel output) {
        this(Dataflow.retrieveCurrentDFPGroup(), output);
    }

    public Pipeline(final Pool pool, final DataflowReadChannel output) {
        this(new DefaultPGroup(pool), output);
        if (pool == null) throw new IllegalArgumentException("A pipeline needs a thread pool to work with.");
    }
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

        separate(Dataflow.retrieveCurrentDFPGroup(), params, outputs, code);
    }

    @Override
    public void separate(Pool pool, Map<String, Object> params, List<DataflowWriteChannel<?>> outputs, Closure<List<Object>> code) {
        separate(new DefaultPGroup(pool), params, outputs, code);
    }
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

        return chainWith(Dataflow.retrieveCurrentDFPGroup(), closure);
    }

    @Override
    public final <V> DataflowReadChannel<V> chainWith(final Pool pool, final Closure<V> closure) {
        return chainWith(new DefaultPGroup(pool), closure);
    }
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

        return chainWith(Dataflow.retrieveCurrentDFPGroup(), params, closure);
    }

    @Override
    public final <V> DataflowReadChannel<V> chainWith(final Pool pool, final Map<String, Object> params, final Closure<V> closure) {
        return chainWith(new DefaultPGroup(pool), params, closure);
    }
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

        into(Dataflow.retrieveCurrentDFPGroup(), target);
    }

    @Override
    public void into(final Pool pool, final DataflowWriteChannel<T> target) {
        into(new DefaultPGroup(pool), target);
    }
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

        into(Dataflow.retrieveCurrentDFPGroup(), params, target);
    }

    @Override
    public void into(final Pool pool, final Map<String, Object> params, final DataflowWriteChannel<T> target) {
        into(new DefaultPGroup(pool), params, target);
    }
View Full Code Here

Examples of groovyx.gpars.group.DefaultPGroup

        split(Dataflow.retrieveCurrentDFPGroup(), target1, target2);
    }

    @Override
    public void split(final Pool pool, final DataflowWriteChannel<T> target1, final DataflowWriteChannel<T> target2) {
        split(new DefaultPGroup(pool), target1, target2);
    }
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.