PHPDaemon\Clients\Mongo\Pool::request PHP Method

request() public method

Gets the key
public request ( integer $opcode, string $data, boolean $reply = false, Connection $conn = null, callable $sentcb = null ) : void
$opcode integer Opcode (see constants above)
$data string Data
$reply boolean Is an answer expected?
$conn Connection Connection. Optional
$sentcb callable Sent callback
return void
    public function request($opcode, $data, $reply = false, $conn = null, $sentcb = null)
    {
        $cb = $this->requestCbProducer($opcode, $data, $reply, $sentcb);
        if (is_object($conn) && $conn instanceof Connection) {
            if ($conn->isFinished()) {
                throw new ConnectionFinished();
            }
            $cb($conn);
        } elseif ($this->finished) {
            $cb(false);
        } else {
            $this->getConnectionRR($cb);
        }
    }