Fwd: [PECL-DEV] publish extension
| From: | xinhua guo | Date: | Mon, 26 Jan 2015 03:26:13 +0000 |
| Subject: | Fwd: [PECL-DEV] publish extension | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-12550@lists.php.net to get a copy of this message | ||
I have wait more than one week, what's the next step please?
---------- Forwarded message ----------
From: xinhua guo <guoxinhua26@gmail.com>
Date: 2015-01-16 14:57 GMT+08:00
Subject: Re: [PECL-DEV] publish extension
To: Antony Dovgal <tony@daylessday.org>
抄送: pecl-dev@lists.php.net
Thank you for your comments Antony,
I have fix ,the 1,2,4 point. and commited to github.
About the 3 point, I know E_ERROR will kill the process, in some
situation, I let the process down intentionally to send a FIN packet
to proxy process to release the TCP connection that the down process
holding.
About the 5 point, I know that this method is not good, I began to use
the "code" attribute to determine whether some error has occurred, but
the redis exception class do not have the "code" property.
I can not figure the better way out now.
by the way: I am a phper and this is my first extension. I have used
it to solve our company's DB layer troubles.
2015-01-16 1:08 GMT+08:00 Antony Dovgal <tony@daylessday.org>:
> A few comments after a quick look at the code:
>
> 1)
> int errorno;
> ..
> if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsss|z", &errorno,
>
> the "l" modifier in parse_parameters expects long, not int.
> But string lengths are int. It's a bit counterintuitive, yes.
>
> 2) zend_error() is for Zend Engine only and should never be called from an
> extension, use php_error_docref() instead
> 3) E_ERROR should only be used if the engine cannot continue execution,
> using it for errors in an extension is definitely an overkill
> 4) there are quite a lot of debug/error printfs in the code
> 5) I do not think this is the best way to determine if there were any
> errors:
>
> char *p = strstr(Z_STRVAL_P(str), "server has gone away");
> char *p2 = strstr(Z_STRVAL_P(str), "There is already an active
> transaction");
> if (p || p2) {
> zend_hash_del(&pdo_object_table, Z_STRVAL_PP(data_source),
> Z_STRLEN_PP(data_source));
> }
>
>
> All in all, the extension looks like a hack to me, I don't believe this
> should be in PECL.
>
>
>
> On 01/15/2015 05:18 AM, guo xinhua wrote:
>>
>> I have writen a php extension and i want publish to pecl.
>>
>> The extension start a proxy process and hold some pdo and redis
>> connections,
>> It provide local connect pool like java.
>>
>>
>> Technical characteristics:
>>
>> - After each time fetchAll (set/get) call release() method, release
>> the connection to the pool, avoid that the script jammed causing
>> connection occupy high.
>> - The maximum and minimum number of connections configuration support.
>> - Support small pressure automatic recovery connection.
>> - Support graceful restart (reload).
>> - Do a lot of optimization, although the request through the
>> connection pool process forward, but no loss of QPS.
>> - When the connection use out,support queue.
>> - Simple! just change the new method and add release function (see
>> demon),you used the tcp pool.
>> - The connection proxy will start the ping process to monitor down
>> list, if available will reflect to the return value of the
>> get_disable_list(), use this function you can do some fun things,like
>> LB.
>>
>> The code on git:
>> github.com/swoole/php-cp
>>
>>
>> I am Gray,25 years old,live in china , my chinese name is xinhua.guo,
>> i work on jumei.
>>
>>
>> btw:I have translate the conf,demon.php and readme.
>>
>
>
> --
> Wbr,
> Antony Dovgal
> ---
> http://pinba.org - realtime profiling for PHP
>
>
> --
> PECL development discussion Mailing List (http://pecl.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>