Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

can ItemEventListener be improved ?

$
0
0

Current scenario :

 

If have 100 pubsub nodes  and i want item chnages from them  i have to do

             LeafNode leafNode = pubSubManager.getNode("NODENAME");

            leafNode.addItemEventListener(new myItemListener());

so that it can listen to changes from all 100 nodes.

 

If I don't do above 2 statments server does send me broadcast message item event ab the item changes but I cannot get as the listener is not added.

 

Instead of creating

ConcurrentHashMap<ItemEventListener<Item>, PacketListener> itemEventToListenerMap = new ConcurrentHashMap<ItemEventListener<Item>, PacketListener>();

 

can we improve it to have a common packet listener for all the message type with itemevent ?

This will save node retrieval for 100 nodes and ram memory for HashMap with 100 nodes ?

 

Thanks

Jeet


Viewing all articles
Browse latest Browse all 10742

Trending Articles