No longer use an extra thread to schedule pending events

Move processing of pending events to the defaultQueue in a non invasive
way so that this processing should not interfere with other important
tasks in the queue for longer than it takes to process a single entry.
This is achieved by using a new ChainedScheduler class which breaks the
workload up into small pieces with their own task each, and only places
a new task in the queue each time a task begins execution. This creates
a natural load based throttling which can execute fast when there is no
load in the executor, but mostly gets out of the way when load is high.

This move also avoids delaying plugin startup until all the pending
events are read from disk. This allows new replication events being
created on the server to be scheduled before all pending events have
been scheduled which results in a slight priority boost for new events
over pending events.

Change-Id: Icddf88b85dec9078bb4a7923b9211614989978ff
4 files changed
tree: 3131da40a6ae819efed8cb63fbb7a44a51782f1a
  1. .settings/
  2. src/
  3. .gitignore
  4. .mailmap
  5. BUILD
  6. LICENSE