Revision 3 as of 2013-12-16 17:20:03

Clear message

Object Methods

Synchronous, asynchronous and transactional programming

Most APIs will be synchronous. APIs would block for significant time should be (such as those that send a message and wait for a reply) should be offered as both synchronous and asynchronous flavors. This shall be implemented as follows:

Example:

Version HelloExchange(int node, Version myVersion, Wakeable& wake); // Returns other node's version, raises exception on error

Application code can call this function in the following ways:

   1 HelloExchange(1,"1.0.0");

   1 ThreadSemaphore sem;
   2 HelloExchange(1,"1.0.0",sem);
   3 sem.take();  // Blocks until hello exchange "gives" the semaphore
   4