mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-17 17:47:12 +00:00
* Added test-ffi target, use it in CI * Added clang-format config, fixed RETURN_STRING API mismatch * Skip installing php and packages on the PHP docker images * Removed al2 job that was never going to work, and compiler tests * Fixed basic test for extension loading * Cleaned up lib structure, fixed tests * use test-ci target to conditionally test in GitHub * Use v0.8.1 of builder
32 lines
863 B
PHP
32 lines
863 B
PHP
<?php
|
|
|
|
/**
|
|
* Represents 1 or more event loops (1 per thread) for doing I/O and background tasks.
|
|
* Typically, every application has one EventLoopGroup.
|
|
*
|
|
* @param array options:
|
|
* - int num_threads - Number of worker threads in the EventLoopGroup. Defaults to 0/1 per logical core.
|
|
*/
|
|
final class EventLoopGroup extends NativeResource {
|
|
|
|
static function defaults() {
|
|
return array(
|
|
'num_threads' => 0,
|
|
);
|
|
}
|
|
|
|
function __construct(array $options = array()) {
|
|
parent::__construct();
|
|
if (count($options) == 0) {
|
|
$options = self::defaults();
|
|
}
|
|
$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();
|
|
}
|
|
}
|