Package groovyx.gpars.group

Examples of groovyx.gpars.group.DefaultPGroup


        final StatefulDynamicDispatchActor downloader = new WriteStatefulDynamicDispatchActor();

        downloader.follower = indexer;
        indexer.follower = writer;

        final PGroup group = new DefaultPGroup(new DefaultPool(false, 4));

        writer.setParallelGroup(group);
        indexer.setParallelGroup(group);
        downloader.setParallelGroup(group);
        downloader.follower = indexer;
        indexer.follower = writer;
        writer.silentStart();
        indexer.silentStart();
        downloader.silentStart();

        final long t1 = System.currentTimeMillis();

        long i = 0;
        while (i < 1000000L) {
            downloader.send("Requested " + i);
            i++;
        }

        downloader.send(new StopMessage());
        downloader.join();
        indexer.join();
        writer.join();
        final long t2 = System.currentTimeMillis();

        System.out.println(t2 - t1);
        group.shutdown();
    }
View Full Code Here


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

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

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

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

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

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

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

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

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

    @Override
    public void split(Pool pool, DataflowWriteChannel<T> target1, DataflowWriteChannel<T> target2) {
        split(new DefaultPGroup(pool), target1, target2);
    }
View Full Code Here

        split(Dataflow.retrieveCurrentDFPGroup(), targets);
    }

    @Override
    public void split(Pool pool, List<DataflowWriteChannel<T>> targets) {
        split(new DefaultPGroup(pool), targets);
    }
View Full Code Here

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

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

        split(Dataflow.retrieveCurrentDFPGroup(), targets);
    }

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

        return tap(Dataflow.retrieveCurrentDFPGroup(), target);
    }

    @Override
    public DataflowReadChannel<T> tap(Pool pool, DataflowWriteChannel<T> target) {
        return tap(new DefaultPGroup(pool), target);
    }
View Full Code Here

TOP

Related Classes of groovyx.gpars.group.DefaultPGroup

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.