|Constructor and Description|
A factory for constructing the asynchronous response building workflow.
|Modifier and Type||Method and Description|
Builds the asynchronous workflows.
@Inject public DefaultAsynchronousWorkflowsBuilder(ApiJobStore apiJobStore, PreResponseStore preResponseStore, Clock timestampGenerator)
apiJobStore- A service for storing and requesting job metadata
preResponseStore- A service for storing and requesting query results
timestampGenerator- The clock to use to generate timestamps
public AsynchronousWorkflows buildAsynchronousWorkflows(rx.Observable<PreResponse> preResponseEmitter, rx.Observable<Either<PreResponse,JobRow>> payloadEmitter, JobRow jobMetadata, Function<JobRow,String> jobMetadataSerializer)
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
preResponseEmitter- The Observable that will eventually emit the results of the backend query
payloadEmitter- The Observable that will emit the results of the query if the query is synchronous, and the job metadata if the query is asynchronous
jobMetadata- The query's metadata
jobMetadataSerializer- A function that serializes a given JobRow into the payload to return to the user
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.