And then I guess I can use a countdown latch to make sure all writes
happened?  Before returning response?
On Jul 23, 2015 4:08 PM, "vkulichenko [via Apache Ignite Users]" <
[email protected]> wrote:

> 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
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-ignite-users.70518.x6.nabble.com/Best-way-to-put-in-multiple-caches-tp645p695.html
>  To unsubscribe from Best way to put in multiple caches., click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=645&code=amF2YS5kZXYubXRsQGdtYWlsLmNvbXw2NDV8MTE3NjM4NTY0Mw==>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




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

Reply via email to