Files
awslabs_aws-crt-php/lib/io.php
T
Justin Boswell 7b5ccfd55a Unit tests and I/O bindings (#8)
* Added composer config, added IO/error tests using phpunit

* Added ApiGen doc comments

* Added test to ensure last_error is not set from loading up the CRT
2021-02-09 10:26:41 -08:00

28 lines
742 B
PHP

<?php
require_once('crt.php');
final class EventLoopGroupOptions {
/**
* @var int $num_threads - Number of worker threads in the EventLoopGroup. Defaults to 0/1 per logical core.
*/
public $num_threads = 0;
}
/**
* Represents 1 or more event loops (1 per thread) for doing I/O and background tasks.
* Typically, every application has one EventLoopGroup.
*/
final class EventLoopGroup extends NativeResource {
function __construct($options) {
parent::__construct();
$this->acquire(self::$crt->event_loop_group_new($options->num_threads));
}
function __destruct() {
self::$crt->event_loop_group_release($this->native);
$this->release();
parent::__destruct();
}
}