Symphony-DAS/symphony-core — pull request #14 by cafarm (2013-07-01 03:21:30+00:00)
Title: Epoch queue

I've implemented the epoch queue.

This enables eliminating the inter-epoch gap; allowing for continuous acquisition in Symphony.

How protocols must change:

Currently protocols prepare, run and complete epochs one at a time. The current epoch being run is stored in an epoch property of the protocol and an epochNum property indicates how many epochs have been run by the protocol.

With this proposal, protocols prepare, run and complete epochs in parallel. There is no concept of a "current" epoch and subsequently the epoch and epochNum properties have been removed.

In their place are two new properties: numEpochsQueued and numEpochsCompleted. numEpochsQueued holds the number of epochs queued by the protocol. numEpochsCompleted holds the number of epochs completed by the protocol.

When running, protocols queue epochs into the epoch queue by calling prepareEpoch(), over and over, and passing it the epoch to be prepared. The protocol will continue to queue epochs until a new method, continueQueuing(), returns false. Typically continueQueuing() is set to return false when numEpochsQueued reaches your desired number of epochs.

While queuing, the epoch queue will begin running in parallel.

As epochs are completed, the completeEpoch() method will be called and passed the completed epoch. After each completed epoch, continueRun() will be called to determine if the protocol should continue running. Typically continueRun() is set to return false when numEpochsCompleted reaches your desired number of epochs.

See the new ExamplePulse protocol to get an idea of what will be required to change in your own protocols.

There's a lot more to say on this proposal but I'd rather start a discussion than ramble on.