michaelmarconi/oncue — pull request #91 by mfoo (2014-10-30 17:10:29+00:00)
Title: Capacity scheduler multiple unique jobs

Allows multiple jobs to have "only run one of me at the same time" uniqueness constraints. Allows defining different composite keys of (worker type, list of parameters) to be considered for uniqueness in each job type.

Configuration looks like this:

uniqueness-constraints: [
{
worker-type = "oncue.tests.workers.TestWorker"
uniqueness-keys: [
"code"
"foo"
]
}
{
worker-type = "oncue.tests.workers.TestWorker2"
uniqueness-keys: [
"code"
]
}
{
worker-type = "oncue.tests.load.workers.SimpleLoadTestWorker"
}
]

This PR also fixes another bug with object references being passed around and modified, plus many problems with the `InMemoryBackingStore` that uses object equality in order to find `Job`s in `List`s, but this doesn't work when you're passing modified cloned objects - `Job`s with the same `id` are not equal.

I looked into making the `Job` class immutable with a builder style pattern to make it clearer that these objects will not be the same, but it hits too many places for now.