Re: SEGINT, readline extension & clean script exit - how to do it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi Richard,

Richard Lynch wrote:
> On Tue, November 28, 2006 7:25 am, Jochem Maas wrote:
>> so the question is how can I use readline() and handle the SIGINT
>> gracefully whilst not waiting
>> for readline() to return control to my script?
> 
> I'm just guessing here, but you probably don't.

I guess so too. would you consider it a bug that php defers the
processing of system signals whilst readline() is waiting to return
control to the script? and what is the likelihood that this has anything
to do with php? if it is down to the readline extension itself I would
be surprised - I would have expected a lib like GNU's readline to take
account of signals and handle them correctly/gracefully.


> 
> You could, howver, write your own PHP function similar to readline,
> only without whatever is in readline that ignores/buffers signals.
> 
> You'd want something like an fread($x, 1) on a non-blocking stream,
> and then build up the string character by character, until you get a
> newline.

I can live with it the way it is - having followed your battle with non-blocking
madness in various threads in the past I don't feel much for diving into that
abyss myself (it doesn't help that my undertstanding of streams is patchy at best!)

one day the readline annoyance will start to grate so much I'll be forced to
look into it :-) no doubt I'll get stuck and need the help of a Non-Blocking 'expert'

anyway,
thanks for all you input (on every question I posed in last few days!)

regard,
Jochem

> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux