The data source's identifier.
Execute a collection of requests.
Execute a collection of requests. The outer Chunk
represents batches
of requests that must be performed sequentially. The inner Chunk
represents a batch of requests that can be performed in parallel.
Returns a data source that executes at most n
requests in parallel.
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.
Returns a new data source that executes requests by sending them to this data source and that data source, returning the results from the first data source to complete and safely interrupting the loser.
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 B
using the
specified effectual function to transform B
requests into requests that
this data source can execute.
(Since version 0.3.0) use contramapZIO
Provides this data source with its required environment.
Provides this data source with its required environment.
(Since version 2.0.0) use provideEnvironment
Provides this data source with part of its required environment.
Provides this data source with part of its required environment.
(Since version 2.0.0) use provideSomeEnvironment
A
DataSource[R, A]
requires an environmentR
and is capable of executing requests of typeA
.Data sources must implement the method
runAll
which takes a collection of requests and returns an effect with aCompletedRequestMap
containing a mapping from requests to results. The type of the collection of requests is aChunk[Chunk[A]]
. The outerChunk
represents batches of requests that must be performed sequentially. The innerChunk
represents a batch of requests that can be performed in parallel. This allows data sources to introspect on all the requests being executed 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 theCompletedRequestsMap
using 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 aQueryFailure
when run.