Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Enrico S. on June 19, 2014, 03:05:17 pm



Title: Catching OS signal SIGINT during a DIALOG
Post by: Enrico S. on June 19, 2014, 03:05:17 pm
Hi.
Is there a way to catch an OS signal SIGINT (or SIGQUIT) inside a DIALOG ?

The purpose of this is to detect when another process send a signal to a running BDL program.
I figured a code stub similar to the following:

...
DEFER INTERRUPT -- (or also DEFER QUIT)
...
INPUT BY NAME my_field_list
  ...
  ON ACTION INTERRUPT
    LET INT_FLAG = FALSE
    CALL my_func()
  ...
END INPUT
...

Running the code stub above, the INTERRUPT action is triggered if the user press the INTERRUPT button. This is correct, obviously.
If I send a SIGINT signal to the program process from OS (by example "kill -2 fglrun_pid") the INPUT detect the signal (as you can see with debugger) but no action is triggered.

I known that the signal handling is provided to allow user to stop a time expensive process while a DIALOG is waiting for it.
My question sound like a different behaviour I would like be supported in Genero.

May be I'm in error and Genero does support a similar behaviour ?

Someone had a similar need and found a solution ?

With best regards.
Enrico.





Title: Re: Catching OS signal SIGINT during a DIALOG
Post by: Reuben B. on June 25, 2014, 07:45:51 am
Perhaps expand on your requirements, and clarify what sort of signal/message you want to send.

Something like this https://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassMessageServer.html maybe close.

The difficulty with most of these types of requests is having to have something in every dialog statement in order to respond to the notification no matter what dialog you are in and/or do you want to respond to the signal/message straight away or can it wait until the user finishes what they are doing.