NCache 4.4 - Online Documentation

Overview

 
NCache supports both synchronous and asynchronous (async) development.  There are situations when the user would like to perform some operations in the background, while working on more critical operations. Suppose that an application updates a batch of keys to cache. It also needs to carry other operations such as receiving data from cache. Here the actual need of asynchronous operations is evolved.
 
Need of Asynchronous Operations: These operations are used when  an application has 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 application in term of faster response time and enhances the overall responsiveness. This means that an application regains control while performing long-running tasks in background.
NCache provides asynchronous counterpart for almost every synchronous operations. As asynchronous operations do not notify upon the failure or success of the operations themselves, so 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 operations status.
 
Working of Asynchronous Operations
When an application issues request for adding/updating data to the cache or removing it from cache 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.
 
 
See Also