ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Magda <dma...@gridgain.com>
Subject Re: Client<->Server communication
Date Mon, 01 Feb 2016 12:39:13 GMT
Hi, 

There is no need to send a reply to the client in a way you do.

There are versions of Ignite Compute's broadcast and other methods that
return computation result to the caller.

In your particular case you can send the broadcast and process the response
this way

        Collection<String> result = compute.broadcast(new
IgniteCallable<String>() {
            @IgniteInstanceResource
            Ignite ignite;

            @Override public String call() throws Exception {
                return new File("./").getAbsolutePath();
            }
        });

        for (String res : result)
            //process result

Please refer to additional Ignite Compute examples [1] that showcase how
this API can be used in an optimal way.

[1]
https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/computegrid

Regards,
Denis



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Client-Server-communication-tp2788p2790.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message