-
Notifications
You must be signed in to change notification settings - Fork 8
New Home
leithaus edited this page Mar 19, 2011
·
5 revisions
The core broker is expressed as a parametrically polymorphic pattern using delimited continuations in monadic style to match consumers to producers. Some of the features that come out of this architecture are
- typed messaging that aligns perfectly with π-calculus style sorts
- huge range of messaging styles from pub/sub to queue'd to join patterns all expressed in one neat package
- scaling -- initial performance tests suggests this has nice scaling properties -- though this hasn't been properly stressed
The current architecture looks like this
/ XMLDB XMLDB \
kvdb kvdb
\ RabbitMQClient <-> RabbitMQBroker <-> RabbitMQBroker <-> RabbitMQClient /
XQuery/docs/diagrams/SpecialKGetFlow.pdf
with the kvdb providing an in-memory cache with the core broker as described above.
The programming API for this is incredibly simple. A programmer writes
reset{ // mark the boundary of the delimited continuation
for(
event1 <- kvdb.get( <PrologTerm1> ); // get the stream of events matching pattern1
... ;
eventK <- kvdb.get( <PrologTermK> ) // get the stream of events matching patternK
if filter( event1, ..., eventK ) // only call the continuation below if events meet a condition
) {
// complex event handling code goes here
...
}
}
All the threading, session management, etc is handled behind this API -- which effects a join pattern.