Package io.servicetalk.concurrent.api
Class SourceAdapters
- java.lang.Object
-
- io.servicetalk.concurrent.api.SourceAdapters
-
public final class SourceAdapters extends java.lang.ObjectA set of adapter methods to convert an asynchronous source in this module to a corresponding source inio.servicetalk.concurrentmodule.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CompletablefromSource(CompletableSource source)Converts the providedCompletableSourceinto aCompletable.static <T> Publisher<T>fromSource(PublisherSource<T> source)Converts the providedPublisherSourceinto aPublisher.static <T> Single<T>fromSource(SingleSource<T> source)Converts the providedSingleSourceinto aSingle.static CompletableSourcetoSource(Completable completable)Converts the providedCompletableinto aCompletableSource.static <T> PublisherSource<T>toSource(Publisher<T> publisher)Converts the providedPublisherinto aPublisherSource.static <T> SingleSource<T>toSource(Single<T> single)Converts the providedSingleinto aSingleSource.
-
-
-
Method Detail
-
toSource
public static <T> PublisherSource<T> toSource(Publisher<T> publisher)
Converts the providedPublisherinto aPublisherSource.- Type Parameters:
T- Type of items emitted from thepublisherand the returnedPublisherSource.- Parameters:
publisher-Publisherto convert to aPublisherSource.- Returns:
- A
PublisherSourcerepresentation of the passedPublisher.
-
toSource
public static <T> SingleSource<T> toSource(Single<T> single)
Converts the providedSingleinto aSingleSource.- Type Parameters:
T- Type of items emitted from thesingleand the returnedSingleSource.- Parameters:
single-Singleto convert to aSingleSource.- Returns:
- A
SingleSourcerepresentation of the passedSingle.
-
toSource
public static CompletableSource toSource(Completable completable)
Converts the providedCompletableinto aCompletableSource.- Parameters:
completable-Completableto convert to aCompletableSource.- Returns:
- A
CompletableSourcerepresentation of the passedCompletable.
-
fromSource
public static <T> Publisher<T> fromSource(PublisherSource<T> source)
Converts the providedPublisherSourceinto aPublisher.- Type Parameters:
T- Type of items emitted from thesourceand the returnedPublisher.- Parameters:
source-PublisherSourceto convert to aPublisher.- Returns:
- A
Publisherrepresentation of the passedPublisherSource.
-
fromSource
public static <T> Single<T> fromSource(SingleSource<T> source)
Converts the providedSingleSourceinto aSingle.- Type Parameters:
T- Type of items emitted from thesourceand the returnedSingle.- Parameters:
source-SingleSourceto convert to aSingle.- Returns:
- A
Singlerepresentation of the passedSingleSource.
-
fromSource
public static Completable fromSource(CompletableSource source)
Converts the providedCompletableSourceinto aCompletable.- Parameters:
source-CompletableSourceto convert to aCompletable.- Returns:
- A
Completablerepresentation of the passedCompletableSource.
-
-