Package io.servicetalk.concurrent.api
Class SourceAdapters
java.lang.Object
io.servicetalk.concurrent.api.SourceAdapters
A set of adapter methods to convert an asynchronous source in this module to a corresponding source in
io.servicetalk.concurrent
module.-
Method Summary
Modifier and TypeMethodDescriptionstatic 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>
Converts the providedPublisher
into aPublisherSource
.static <T> SingleSource<T>
Converts the providedSingle
into aSingleSource
.
-
Method Details
-
toSource
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
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
Converts the providedCompletable
into aCompletableSource
.- Parameters:
completable
-Completable
to convert to aCompletableSource
.- Returns:
- A
CompletableSource
representation of the passedCompletable
.
-
fromSource
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
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
Converts the providedCompletableSource
into aCompletable
.- Parameters:
source
-CompletableSource
to convert to aCompletable
.- Returns:
- A
Completable
representation of the passedCompletableSource
.
-