The data source's identifier.
Execute a collection of requests.
Execute a collection of requests. Data sources are guaranteed that the
collection will contain at least one request and that all requests will be
unique when they are called by ZQuery.
Returns a new data source that executes requests of type B using the
specified function to transform B requests into requests that this data
source can execute.
Returns a new data source that executes requests of type B using the
specified effectual function to transform B requests into requests that
this data source can execute.
Returns a new data source that executes requests of type C using the
specified function to transform C requests into requests that either
this data source or that data source can execute.
Provides this data source with its required environment.
Provides this data source with part of its required environment.
A
DataSource[R, A]is capable of executing requests of typeAthat require an environmentR.Data sources must implement the method
runwhich takes a collection of requests and returns an effect with aCompletedRequestMapcontaining a mapping from requests to results. Becauserunis parameterized on a collection of requests rather than a single request, data sources have the ability to introspect on all the requests being executed in parallel and optimize the query.Data sources will typically be parameterized on a subtype of
Request[A], though that is not strictly necessarily as long as the data source can map the request type to aRequest[A]. Data sources can then pattern match on the collection of requests to determine the information requested, execute the query, and place the results into theCompletedRequestsMapusing CompletedRequestMap.empty and CompletedRequestMap.insert. Data sources must provide results for all requests received. Failure to do so will cause a query to die with aQueryFailurewhen run.