ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkulichenko <valentin.kuliche...@gmail.com>
Subject Re: Best way to put in multiple caches.
Date Thu, 23 Jul 2015 20:03:35 GMT
Hi,

You can use asynchronous cache mode for this. In this mode cache executes
all operations asynchronously and allows to get the future for the last
operation via future() method.

Here is the sample code:

// Switch all caches to async mode. 
cache1 = cache1.withAsync();
cache2 = cache2.withAsync();
cache3 = cache3.withAsync();
cache4 = cache4.withAsync();

// Do all puts asynchronously.
cache1.put(1, "a");
cache2.put(2, "b");
cache3.put(3, "c");
cache4.put(4, "d");

// Wait on all futures.
cache1.future().get();
cache2.future().get();
cache3.future().get();
cache4.future().get();

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Best-way-to-put-in-multiple-caches-tp645p695.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message