mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-06 06:57:43 +03:00
26 lines
782 B
Swift
26 lines
782 B
Swift
//
|
|
// ObservableConvertibleType+Blocking.swift
|
|
// RxBlocking
|
|
//
|
|
// Created by Krunoslav Zaher on 7/12/15.
|
|
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
#if !RX_NO_MODULE
|
|
import RxSwift
|
|
#endif
|
|
|
|
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`
|
|
*/
|
|
// @warn_unused_result(message:"http://git.io/rxs.uo")
|
|
public func toBlocking(timeout: RxTimeInterval? = nil) -> BlockingObservable<E> {
|
|
return BlockingObservable(timeout: timeout, source: self.asObservable())
|
|
}
|
|
}
|