Friday, 8 July 2016

Remote Execution with C++ client

Version 8 of the Infinispan C++ Hotrod Client implements the Execute on Server (Exec) operation. This feature was introduced with Hotrod protocol v 2.1 and has been described for the Java client here.

The user can now store the javascript code on the server then invoke it when needed and let the server take care of the execution both locally on the near node or distibuited on the whole cluster.

The following annotated code is  an example of a C++ Exec that addresses the following use case: the user wants to get a string value and wants to count how many times it has been accessed from all the connected clients.

You can git the whole source following this link.

//Client setup

//Cache setup and scripts installation

//Exec operation and output

No comments:

Post a Comment