@Singleton public class DefaultAsynchronousWorkflowsBuilder extends Object implements AsynchronousWorkflowsBuilder
Constructor and Description |
---|
DefaultAsynchronousWorkflowsBuilder(ApiJobStore apiJobStore,
PreResponseStore preResponseStore,
Clock timestampGenerator)
A factory for constructing the asynchronous response building workflow.
|
Modifier and Type | Method and Description |
---|---|
AsynchronousWorkflows |
buildAsynchronousWorkflows(rx.Observable<PreResponse> preResponseEmitter,
rx.Observable<Either<PreResponse,JobRow>> payloadEmitter,
JobRow jobMetadata,
Function<JobRow,String> jobMetadataSerializer)
Builds the asynchronous workflows.
|
@Inject public DefaultAsynchronousWorkflowsBuilder(ApiJobStore apiJobStore, PreResponseStore preResponseStore, Clock timestampGenerator)
apiJobStore
- A service for storing and requesting job metadatapreResponseStore
- A service for storing and requesting query resultstimestampGenerator
- The clock to use to generate timestampspublic AsynchronousWorkflows buildAsynchronousWorkflows(rx.Observable<PreResponse> preResponseEmitter, rx.Observable<Either<PreResponse,JobRow>> payloadEmitter, JobRow jobMetadata, Function<JobRow,String> jobMetadataSerializer)
AsynchronousWorkflowsBuilder
There are four workflows:
WARNING: Some implementations (i.e. DefaultAsynchronousWorkflowsBuilder
) may communicate with external
resources, or do other potentially expensive operations. If you wish to guarantee that the asynchronous
workflows are executed at most once (as opposed to once per subscription), then make sure to pass in instances of
ConnectableObservable
.
buildAsynchronousWorkflows
in interface AsynchronousWorkflowsBuilder
preResponseEmitter
- The Observable that will eventually emit the results of the backend querypayloadEmitter
- The Observable that will emit the results of the query if the query is
synchronous, and the job metadata if the query is asynchronousjobMetadata
- The query's metadatajobMetadataSerializer
- A function that serializes a given JobRow into the payload to return to the userCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.