     }
 }
 
-public class RepeatedOperation<Generator: GeneratorType where Generator.Element: NSOperation>: GroupOperation {
+public class RepeatedOperation<G: GeneratorType where G.Element: NSOperation>: GroupOperation {
 
-    private var delay: TimeDelayGenerator
-    private var generator: Generator
-    public internal(set) var operation: Generator.Element? = .None
+    private var delay: AnyGenerator<NSTimeInterval>
+    private var generator: G
+    public internal(set) var operation: G.Element? = .None
 
-    public init(min: NSTimeInterval = 1, max: MaximumTimeInterval = .Backoff, maxNumberOfAttempts attempts: Int? = .None, generator: Generator) {
-        self.delay = TimeDelayGenerator(min: min, max: max, attempts: attempts)
+    public init(min: NSTimeInterval = 1, max: MaximumTimeInterval = .Backoff, maxNumberOfAttempts attempts: Int? = .None, generator: G) {
+        self.delay = anyGenerator(TimeDelayGenerator(min: min, max: max, attempts: attempts))
         self.generator = generator
         super.init(operations: [])
         name = "Repeated Operation"

    }
}

public protocol RepeatingOperationType {
    var shouldRepeat: Bool { get }
}

public class RepeatingOperationGenerator<O where O: NSOperation, O: RepeatingOperationType>: GeneratorType {

    private var generator: AnyGenerator<O>
    private var operation: O?

    public init(_ creator: () -> O?) {
        generator = anyGenerator(creator)
    }

    public func next() -> O? {
        if let op = operation {
            guard op.shouldRepeat else {
                return nil
            }
        }

        operation = generator.next()

        return operation
    }
}


    }

    public override func operationDidFinish(operation: NSOperation, withErrors errors: [ErrorType]) {
        if errors.isEmpty, let _ = operation as? G.Element {
            addNextOperation()
        }
    }
