Skip to content
Advertisement

How do I make sure my apache Ignite 2.x distributed cache puts are asynchornous

Below I have a distributed cache example using apache ignite.

I want to make it so when I do a cache put operation: cache.put(i, new X12File("x12file" + i, LocalDateTime.now().toString())); that it is completely asynchronous. Meaning my put operation should be super fast, and the pushing to the rest of the cluster should happen in the background not inconveniencing the user. I need “fire and forget” functionality.

I am struggling to find an async option in the documentation. Can someone help me understand how to change this code to make my puts as “fire and forget” as possible? Thanks!

JavaScript

Advertisement

Answer

Check out IgniteCache#putAsync(..)

see: https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteCache.html#putAsync-K-V-

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement