Sending for Rob Alexander: pg_notify send msg to Omnis
Graham Stevens
graham.stevens at gmail.com
Wed Jul 10 04:10:43 EDT 2019
Hi Rob,
This is quite simple to set up. Here's what we do:
In your library, create an object class (pPGnotify) and subclass it from
PGSQLDAM.PGSQLSESS.
In oPGnotify.$construct:
Do $cinst.$logon(host,username,password)
Create a public method, $notify with a single parameter:
prefParams Field reference
And in the code you can deal with the messages as you wish:
; prefParams.1.Channel ;; channel
; prefParams.1.PID ;; pid
; prefParams.1.Message ;; payload
Send to trace log $notify on channel "[prefParams.1.Channel]" with
message "[prefParams.1.Message]" from process [prefParams.1.PID]
.
.
.
In your Startup_Task, create an instance variable of type object,
pPGcomms Object oPGnotify
And in your Startup_Task.$construct:
Do oPGcomms.$listen('channelName')
HTH
Best regards,
Graham
On 10/07/2019 08:49, Graham Stevens wrote:
> ------- Forwarded Message --------
> Subject: pg_notify send msg to Omnis
> Date: Mon, 8 Jul 2019 10:38:46 -0400
> From: Rob Alexander <ralexander at mophilly.com> <mailto:ralexander at mophilly.com>
> To: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com> <mailto:omnisdev-en at lists.omnis-dev.com>
>
> Hi $all,
>
> Hoping someone has worked with postgres pg_notify. I want to call into Omnis and run some code when pg_notify gets triggered.
>
> I can send a message with NOTIFY, and I want to get that string into Omnis. Both Mac and Windows.
>
> Ideas? Thoughts?
>
> Thanks very much
>
> Rob Alexander
>
More information about the omnisdev-en
mailing list