Package io.servicetalk.concurrent.api
Class SourceAdapters
- java.lang.Object
-
- io.servicetalk.concurrent.api.SourceAdapters
-
public final class SourceAdapters extends java.lang.Object
A set of adapter methods to convert an asynchronous source in this module to a corresponding source inio.servicetalk.concurrent
module.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Completable
fromSource(CompletableSource source)
Converts the providedCompletableSource
into aCompletable
.static <T> Publisher<T>
fromSource(PublisherSource<T> source)
Converts the providedPublisherSource
into aPublisher
.static <T> Single<T>
fromSource(SingleSource<T> source)
Converts the providedSingleSource
into aSingle
.static CompletableSource
toSource(Completable completable)
Converts the providedCompletable
into aCompletableSource
.static <T> PublisherSource<T>
toSource(Publisher<T> publisher)
Converts the providedPublisher
into aPublisherSource
.static <T> SingleSource<T>
toSource(Single<T> single)
Converts the providedSingle
into aSingleSource
.
-
-
-
Method Detail
-
toSource
public static <T> PublisherSource<T> toSource(Publisher<T> publisher)
Converts the providedPublisher
into aPublisherSource
.- Type Parameters:
T
- Type of items emitted from thepublisher
and the returnedPublisherSource
.- Parameters:
publisher
-Publisher
to convert to aPublisherSource
.- Returns:
- A
PublisherSource
representation of the passedPublisher
.
-
toSource
public static <T> SingleSource<T> toSource(Single<T> single)
Converts the providedSingle
into aSingleSource
.- Type Parameters:
T
- Type of items emitted from thesingle
and the returnedSingleSource
.- Parameters:
single
-Single
to convert to aSingleSource
.- Returns:
- A
SingleSource
representation of the passedSingle
.
-
toSource
public static CompletableSource toSource(Completable completable)
Converts the providedCompletable
into aCompletableSource
.- Parameters:
completable
-Completable
to convert to aCompletableSource
.- Returns:
- A
CompletableSource
representation of the passedCompletable
.
-
fromSource
public static <T> Publisher<T> fromSource(PublisherSource<T> source)
Converts the providedPublisherSource
into aPublisher
.- Type Parameters:
T
- Type of items emitted from thesource
and the returnedPublisher
.- Parameters:
source
-PublisherSource
to convert to aPublisher
.- Returns:
- A
Publisher
representation of the passedPublisherSource
.
-
fromSource
public static <T> Single<T> fromSource(SingleSource<T> source)
Converts the providedSingleSource
into aSingle
.- Type Parameters:
T
- Type of items emitted from thesource
and the returnedSingle
.- Parameters:
source
-SingleSource
to convert to aSingle
.- Returns:
- A
Single
representation of the passedSingleSource
.
-
fromSource
public static Completable fromSource(CompletableSource source)
Converts the providedCompletableSource
into aCompletable
.- Parameters:
source
-CompletableSource
to convert to aCompletable
.- Returns:
- A
Completable
representation of the passedCompletableSource
.
-
-