Package com.lmax.disruptor

Examples of com.lmax.disruptor.SingleThreadedClaimStrategy


        NeoStore neoStore = inserter.getNeoStore();
        neoStore.getNodeStore().setHighId(nodesToCreate + 1);
        final int processors = Runtime.getRuntime().availableProcessors();
        executor = processors >=8 ? Executors.newFixedThreadPool(processors*2) : Executors.newCachedThreadPool();

        disruptor = new Disruptor<NodeStruct>(nodeStructFactory, executor, new SingleThreadedClaimStrategy(ringSize), new YieldingWaitStrategy());
        disruptor.handleExceptionsWith(new BatchInserterExceptionHandler());
        createHandlers(neoStore, nodeStructFactory);

        disruptor.
                handleEventsWith(propertyMappingHandlers).
View Full Code Here


        NeoStore neoStore = inserter.getNeoStore();
        neoStore.getNodeStore().setHighId(nodesToCreate + 1);
        executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
        //final ExecutorService executor = Executors.newCachedThreadPool();

        incomingEventDisruptor = new Disruptor<NodeStruct>(nodeStructFactory, executor, new SingleThreadedClaimStrategy(RING_SIZE), new YieldingWaitStrategy());

        createHandlers(neoStore,nodeStructFactory);

        incomingEventDisruptor.
                handleEventsWith(propertyMappingHandlers).
View Full Code Here

     * The sequence claim strategy for the producer is dependent on the number
     * of threads in the gateway.
     */
    private ClaimStrategy getClaimStrategy() {
        if (TextMessageGateway.PUBLISHING_THREADS == 1)
            return new SingleThreadedClaimStrategy(RINGBUFFER_SIZE);

        return new MultiThreadedClaimStrategy(RINGBUFFER_SIZE);
    }
View Full Code Here

TOP

Related Classes of com.lmax.disruptor.SingleThreadedClaimStrategy

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.