Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.LongAdder


    public static int publish(StatType type,JsonNode message) throws IllegalArgumentException{
        if (type ==StatType.ALL){
            throw new IllegalArgumentException("Cannot publish on all channel");
        }
        LongAdder a= new LongAdder();

        String messageToSend=message.toString();
       
        STATS_CHANNELS.getOrDefault(type,DEFAULT).forEach((_e,e)->{
            e.sendData(messageToSend);
            a.increment();

        });

        STATS_CHANNELS.getOrDefault(StatType.ALL,DEFAULT).forEach((_e,e)->{
            e.sendData(messageToSend);
            a.increment();

        });
        return a.intValue();
    }
View Full Code Here

TOP

Related Classes of java.util.concurrent.atomic.LongAdder

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.