Asynchronous Operations
NCache supports both synchronous and asynchronous operations. This sections explains how to use asynchronous operations API provided by NCache to utilize notifications that arise as a result of add, insert or remove operations against all or selective cache items, or when cluster status changes.
Need of Asynchronous Operations
Asynchronous operations are used when applications have important tasks to execute right away instead of blocking updates that are not important. As asynchronous operations cause delayed updates, these delays are expected.
Performance Improvement
It increases the performance of the application with faster response times and enhances the overall responsiveness. This means that application regains control while performing long-running tasks in background.
NCache provides an asynchronous counterpart for almost every synchronous operation. As asynchronous operations do not notify upon the failure or success of the operations themselves, NCache provides a Callback feature for asynchronous operations.
Callback Method
NCache provides optional Callback Methods for asynchronous operations. Callbacks are responsible for providing acknowledgment to application about the operation’s status.
Asynchronous Operations Works
When your application issues request for adding/updating data to the cache or removing from it with asynchronous API call, NCache uses a thread pool on the server side to facilitate these operations. Whereas in case of any callback registered with asynchronous operations, NCache triggers appropriate events only for interested clients upon operation completion.
Note
In case of failure of an Asynchronous operation, the server will not throw any exception.
In This Section
Using Asynchronous Operations
Explains how to perform different asynchronous operations on cache using NCache Client API.
Using Asynchronous Callback Methods
Explains how to register different asynchronous callbacks on cache using NCache Client API.