RxSwift/RxBlocking/ObservableConvertibleType+Blocking.swift
2017-11-04 18:53:02 +01:00

20 lines
684 B
Swift

//
// ObservableConvertibleType+Blocking.swift
// RxBlocking
//
// Created by Krunoslav Zaher on 7/12/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import RxSwift
extension ObservableConvertibleType {
/// Converts an Observable into a `BlockingObservable` (an Observable with blocking operators).
///
/// - parameter timeout: Maximal time interval BlockingObservable can block without throwing `RxError.timeout`.
/// - returns: `BlockingObservable` version of `self`
public func toBlocking(timeout: RxTimeInterval? = nil) -> BlockingObservable<E> {
return BlockingObservable(timeout: timeout, source: self.asObservable())
}
}