Code Duplication    Length = 16-16 lines in 2 locations

src/Pool.php 2 locations

@@ 118-133 (lines=16) @@
115
        ]));
116
    }
117
118
    protected function waitForPaginateCall($tableName, $params, $settings)
119
    {
120
        $deferred = new Deferred();
121
122
        $this->loop->addPeriodicTimer(
123
            0.1,
124
            function (TimerInterface $timer) use ($deferred, $tableName, $params, $settings) {
125
                if ($this->pool instanceof PoolInterface) {
126
                    $timer->cancel();
127
                    $deferred->resolve($this->paginateCall($tableName, $params, $settings));
128
                }
129
            }
130
        );
131
132
        return $deferred->promise();
133
    }
134
135
    /**
136
     * @inheritDoc
@@ 205-220 (lines=16) @@
202
     * @param  array            $arguments
203
     * @return PromiseInterface
204
     */
205
    protected function waitForPoolCall($tableName, $function, array $arguments)
206
    {
207
        $deferred = new Deferred();
208
209
        $this->loop->addPeriodicTimer(
210
            0.1,
211
            function (TimerInterface $timer) use ($deferred, $tableName, $function, $arguments) {
212
                if ($this->pool instanceof PoolInterface) {
213
                    $timer->cancel();
214
                    $deferred->resolve($this->call($tableName, $function, $arguments));
215
                }
216
            }
217
        );
218
219
        return $deferred->promise();
220
    }
221
}
222