PostgreSQL listen/notify and the method stack
Doug Easterbrook
doug at artsman.com
Thu Nov 23 13:29:53 UTC 2023
The other thing you can do if you are concerned is make a listen notify handler. I have an example in the pgsqldam object in the sample code from euromis
If you get a notify, then add it to a list of pending calls. When you’d stack has diminished. Call a routine to process the pending notifies in the list and clean the list out
That make notify nothing more than add line to pending list so it pretty much eliminates potential interaction with other code
I don’t think you should worry about, but then I don’t know how much work you are doing in the notify
------------
Doug Easterbrook
Arts Management Systems Ltd.
doug at artsman.com
> On Nov 23, 2023, at 6:38 AM, Doug Easterbrook <doug at artsman.com> wrote:
>
> As far as I understand the timer is popped on the stack
>
> It’s the same as background workers
>
> So it eventually gets executed as the omnis stack winds down
>
> Just make sure your variable scope is right and you won’t have problems
>
>
> All Timers act the same way
>
> ------------
> Doug Easterbrook
> Arts Management Systems Ltd.
> doug at artsman.com
>
>> On Nov 23, 2023, at 2:48 AM, Nick Renders via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
>>
>> Hello fellow Omnis-Potents,
>>
>> I have noticed that when implementing the $listen and $notify methods of the PostgreSQL DAM, the $notify method actually interrupts the current method stack. So when Omnis is executing a certain method, the notification will cut in, execute the $notify method, and return to the previous method where it left off. At least that is what I've come to understand after doing some tests.
>>
>> I'm not very comfortable with the $notify method interrupting any possible method at any possible time. Has anyone encountered this before? Does anyone have any good tips and/or tricks on managing listeners/notifiers?
>>
>> Best regards,
>>
>> Nick Renders
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list