Class Overview
Data source that wraps number of other data sources and waits until all of them are finished.
After that each call to getResult() returns list of final results of wrapped data sources.
Caller of getResult() is responsible for closing all each of the results separately.
This data source does not propagate intermediate results.
Summary
[Expand]
Inherited Methods |
From class
com.facebook.datasource.AbstractDataSource
boolean
|
close()
Cancels the ongoing request and releases all associated resources.
|
void
|
closeResult(T result)
Subclasses should override this method to close the result that is not needed anymore.
|
synchronized
Throwable
|
getFailureCause()
|
synchronized
float
|
getProgress()
|
synchronized
T
|
getResult()
The most recent result of the asynchronous computation.
|
synchronized
boolean
|
hasFailed()
|
synchronized
boolean
|
hasResult()
|
synchronized
boolean
|
isClosed()
|
synchronized
boolean
|
isFinished()
|
void
|
notifyProgressUpdate()
|
boolean
|
setFailure(Throwable throwable)
Subclasses should invoke this method to set the failure.
|
boolean
|
setProgress(float progress)
Subclasses should invoke this method to set the progress.
|
boolean
|
setResult(T value, boolean isLast)
Subclasses should invoke this method to set the result to value .
|
void
|
subscribe(DataSubscriber<T> dataSubscriber, Executor executor)
Subscribe for notifications whenever the state of the DataSource changes.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
com.facebook.datasource.DataSource
abstract
boolean
|
close()
Cancels the ongoing request and releases all associated resources.
|
abstract
Throwable
|
getFailureCause()
|
abstract
float
|
getProgress()
|
abstract
T
|
getResult()
The most recent result of the asynchronous computation.
|
abstract
boolean
|
hasFailed()
|
abstract
boolean
|
hasResult()
|
abstract
boolean
|
isClosed()
|
abstract
boolean
|
isFinished()
|
abstract
void
|
subscribe(DataSubscriber<T> dataSubscriber, Executor executor)
Subscribe for notifications whenever the state of the DataSource changes.
|
|
Protected Constructors
Public Methods
public
boolean
close
()
Cancels the ongoing request and releases all associated resources.
Subsequent calls to getResult()
will return null.
Returns
- true if the data source is closed for the first time
public
synchronized
List<CloseableReference<T>>
getResult
()
The most recent result of the asynchronous computation.
The caller gains ownership of the object and is responsible for releasing it.
Note that subsequent calls to getResult might give different results. Later results should be
considered to be of higher quality.
This method will return null in the following cases:
- when the DataSource does not have a result (
hasResult
returns false).
- when the last result produced was null.
public
synchronized
boolean
hasResult
()