Syncrhonous and Asynchronous calls

Todd Wright twright at bbn.com
Wed Nov 14 12:05:51 EST 2007


This design issue is discussed in the "Mandelbrot" demo:
   http://cougaar.org/docman/view.php/17/201/cougaar_mandelbrot.ppt

The code is included in the Cougaar 12.4 release, in:
   demo-mandelbrot.zip

Three design options are discussed:

   v1) Servlet is self-contained

   v2) Servlet invokes a synchronous Service, e.g. a service advertised
       by another plugin.

   v3) Servlet publishes a blackboard "Job" request and waits for a
       synchronized "notify()" event or subscription change.

Similar to design v3, your servlet could publish a blackboard request and then 
poll the blackboard for the result, or have the client poll the servlet. 
Polling is easy to implement but can be inefficient.

Todd

Morgan Duchène wrote:
> Hi,
> 
> I have a basic architecture question about the development model with 
> Cougaar.
> * Developments with Cougaar and plugins are based on blackboard 
> registrations to events (objects, tasks, ...). So it is an asynchronous 
> model where plugins are awaken when new events they are interested in 
> are published.
> * Cougaar also offers to interact with "the outside world" with servlets 
> to receive commands for example. When a browser sends a requests for a 
> page to and http server, it's a synchronous call as it waits for the answer.
> 
> So my simple question it this one: if we don't have the data available 
> on the blackboard as the servlet is sending the search parameters 
> (database, files, ...), what is the best way to have plugins give the 
> answer to the servlet?
> 
> Thanks,
> Morgan
> 
> _______________________________________________
> Cougaar-developers mailing list
> Cougaar-developers at cougaar.org
> http://cougaar.org/mailman/listinfo/cougaar-developers
> 



More information about the Cougaar-developers mailing list