You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new `DataLoaderPHP` given a batch loading instance and options.
128
129
129
130
-*$batchLoadFn*: A callable / callback which accepts an Array of keys, and returns a Promise which resolves to an Array of values.
131
+
-*$promiseFactory*: Any object that implements `McGWeb\PromiseFactory\PromiseFactoryInterface`. (see [McGWeb/Promise-Factory](https://github.com/mcg-web/promise-factory))
130
132
-*$options*: An optional object of options:
131
133
132
134
-*batch*: Default `true`. Set to `false` to disable batching, instead
Copy file name to clipboardExpand all lines: composer.json
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
"name": "overblog/dataloader-php",
3
3
"type": "library",
4
4
"license": "MIT",
5
+
"description": "DataLoaderPhp is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.",
@@ -215,10 +221,16 @@ protected function needProcess()
215
221
protectedfunctionprocess()
216
222
{
217
223
if ($this->needProcess()) {
224
+
$this->getPromiseFactory()->await();
218
225
$this->dispatchQueue();
219
226
}
220
227
}
221
228
229
+
protectedfunctiongetPromiseFactory()
230
+
{
231
+
return$this->promiseFactory;
232
+
}
233
+
222
234
/**
223
235
* @param $promise
224
236
* @param bool $unwrap controls whether or not the value of the promise is returned for a fulfilled promise or if an exception is thrown if the promise is rejected
@@ -227,48 +239,28 @@ protected function process()
0 commit comments