         }
         return stream
     }
+
 }
 
 
 // MARK: - StreamPromise -
-public class StreamPromise<T> {
+
+public final class StreamPromise<T> {
     public let future: FutureStream<T>
     
     public init(capacity: Int = Int.max) {

        return future
    }
    
    public func andThen(executionContext: ExecutionContext = QueueContext.futuresDefault, complete: Try<T> -> Void) -> Future<T> {
        let future = Future<T>()
        future.onComplete(executionContext, complete: complete)
        onComplete(executionContext) { result in
            future.complete(result)
        }
        return future
    }
    
    public func recover(executionContext: ExecutionContext = QueueContext.futuresDefault, recovery: ErrorType -> Try<T>) -> Future<T> {
        let future = Future<T>()
        onComplete(executionContext) { result in
            future.complete(result.recoverWith(recovery))
        }
        return future
    }
    
    public func recoverWith(executionContext: ExecutionContext = QueueContext.futuresDefault, recovery: ErrorType -> Future<T>) -> Future<T> {
        let future = Future<T>()
        onComplete(executionContext) { result in
            switch result {
            case .Success(let value):
                future.success(value)

}

// MARK: - Queue -

public struct Queue {
    public static let main = Queue(dispatch_get_main_queue());
    public static let global = Queue(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0))
