jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject Re: Observation design (Was: svn commit: r1351414 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: api/ChangeSet.java api/ContentSession.java core/ContentSessionImpl.java)
Date Tue, 19 Jun 2012 07:27:17 GMT

>>- We can implement the polling approach (using a 0 timeout) but also have
>> the option to do blocking. Since this can be directly delegated to the
>> Microkernel (waitForCommit) the added complexity for this is minimal.
>The complexity is still there, it's just one level below. Personally
>I'd rather drop the waitForCommit() method unless we really do have a
>hard use case for that functionality.

I believe waitForCommit() actually simplify things. It's not a hard use
case, but from an architectural point of view the advantages of
waitForCommit() are:

- no need for polling, and configuring polling frequency
- no need for callbacks
- events are delivered as early as possible

With polling, beside the obvious disadvantage that events are delivered
(possibly a lot) later, polling also needs more CPU cycles, specially when
there are multiple consumers. Also, because of the delayed event delivery,
cache efficiency is reduced, further deceasing performance.


View raw message