Can ThreadedParseRequestDispatcher dispose pending requests when a new request is queued?

SyntaxEditor for WPF Forum

Posted 12 years ago by Mert Akinc
Version: 11.2.0555

According to the Parse Requests and Dispatchers help topic:

Upon receipt of a request, it will generally queue the request, possibly disposing of similar previous requests that are still on the queue.

It doesn't appear that the default implementation, ThreadedParseRequestDispatcher, disposes of previous requests when a new one is queued. That is the behavior I want, because it doesn't seem useful to execute any but the most recent parse request.

Do I just need to implement my own IParseRequestDispatcher?

Comments (2)

Answer - Posted 12 years ago by Mert Akinc

It turns out that it behaves the way I wanted, so long as I construct parse requests with parse hash keys that are document specific, not content specific. So, it was a misunderstanding of parse hash keys.

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Mert,

ThreadedParseRequestDispatcher does implement that behavior already.  A new request will first check the queue to see if there's anything there for the same document and will clear those requests if there is.  Then it will add the new request to the queue.  Note that if a previous request is already in the midst of parsing, that will finish up and return a result (since that is not considered as in the queue at that point).

But you are correct too, the hash codes need to be document-specific so they can be found and replaced.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.