Add support for capacity to WorkQueue template.