phpday 2027 - Call for Papers

Io\Poll\Context::getBackend

(PHP 8 >= 8.6.0)

Io\Poll\Context::getBackend — Returns the backend used by the context

说明

public function Io\Poll\Context::getBackend(): Io\Poll\Backend

Returns the backend that the context polls with. This is never Io\Poll\Backend::Auto: a context created with it reports the backend that was selected.

参数

此函数没有参数。

返回值

Returns the Io\Poll\Backend case of the backend in use.

示例

示例 #1 Io\Poll\Context::getBackend() example

<?php
use Io\Poll\Backend;
use Io\Poll\Context;

$context = new Context();
var_dump($context->getBackend());

$context = new Context(Backend::Poll);
var_dump($context->getBackend());

以上示例的输出类似于:

enum(Io\Poll\Backend::Epoll)
enum(Io\Poll\Backend::Poll)

参见

+添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top