Hello Community,
My application requires me to get max speed out of every request cycle.
It will make multiple API requests and then process those response as soon as they come in.
I have decided to try Phalcon (my first experience with it) and also use pthreads for parallel API requet cycles.
When I try simple threading scripts they work.
But once I make those calls from Phalcon I get erros related to missing Thread components.
If anyone has any experience with Phalcon and pthreads please let me know and I will share my code in detail what works and what does not.
I can share the following to begin with:
$ php -i | grep -i thread
Configure Command => './configure' '--prefix=/etc/php7' '--with-bz2' '--with-zlib' '--enable-zip' '--disable-cgi' '--enable-soap' '--enable-intl' '--with-openssl' '--with-readline' '--with-curl' '--enable-ftp' '--enable-mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-sockets' '--enable-pcntl' '--with-pspell' '--with-enchant' '--with-gettext' '--with-gd' '--enable-exif' '--with-jpeg-dir' '--with-png-dir' '--with-freetype-dir' '--with-xsl' '--enable-bcmath' '--enable-mbstring' '--enable-calendar' '--enable-simplexml' '--enable-json' '--enable-hash' '--enable-session' '--enable-xml' '--enable-wddx' '--enable-opcache' '--with-pcre-regex' '--with-config-file-path=/etc/php7/cli' '--with-config-file-scan-dir=/etc/php7/etc' '--enable-cli' '--enable-maintainer-zts' '--with-tsrm-pthreads' '--enable-debug' '--enable-fpm' '--with-fpm-user=www-data' '--with-fpm-group=www-data'
Thread Safety => enabled
pthreads
$ php --version
PHP 7.2.2 (cli) (built: Feb 19 2018 10:04:19) ( ZTS DEBUG ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.2, Copyright (c) 1999-2018, by Zend Technologies
php.ini
Web framework delivered as a C-extension for PHP
phalcon enabled
Author Phalcon Team and contributors
Version 3.3.1
Build Date Jan 10 2018 00:17:28
Powered by Zephir Version 0.10.7-2917ebe8ae
Directive Local Value Master Value
phalcon.db.escape_identifiers On On
phalcon.db.force_casting Off Off
phalcon.orm.cast_on_hydrate Off Off
phalcon.orm.column_renaming On On
phalcon.orm.disable_assign_setters Off Off
phalcon.orm.enable_implicit_joins On On
phalcon.orm.enable_literals On On
phalcon.orm.events On On
phalcon.orm.exception_on_failed_save Off Off
phalcon.orm.ignore_unknown_columns Off Off
phalcon.orm.late_state_binding Off Off
phalcon.orm.not_null_validations On On
phalcon.orm.update_snapshot_on_save On On
phalcon.orm.virtual_foreign_keys On On