Package org.agilewiki.jactor.apc

The apc package implements Asynchronous Procedure Calls (APC), or two-way messaging.

See: Description

Package org.agilewiki.jactor.apc Description

The apc package implements Asynchronous Procedure Calls (APC), or two-way messaging. A message is treated as either a request or a response, where for every request there is exactly one response.

Actors traditionally use one-way messaging, which can be difficult to understand when the code of an actor becomes large. The apc package instead uses messages to implement something closer to a method call. It also has the advantage of implicitly implementing flow control--which tends to result in systems that behave well under load.

Another advantage of using two-way messages is improved exception handling. If an exception is thrown while processing a request and there is no exception handler, then the exception is passed up to the actor which sent the request, recursively.

An echo test running multiple pairs with 1000 messages per burst processed 49 million messages per second--20 nanoseconds per message. But when messages are sent one at a time, only 4255319 messages are processed per second--235 nanoseconds per message. Sending messages in bursts, which simulates a system under load, is 1,075% faster.

Copyright © 2012. All Rights Reserved.