© 2024 InterSystems Corporation, Cambridge, MA. All rights reserved.Privacy & TermsGuaranteeSection 508Contest Terms
Initial Release
This is an example of $SYSTEM.Event usage.
A DC article is availalbe in FR here and EN soon.
Clone/git pull the repo into any local directory
$ git clone https://github.com/lscalese/iris-ipc-utils.git
$ docker-compose up -d
Open a terminal a start to listen the event “Demo”
IRISAPP>Do ##class(dc.ipcutils.BasicListener).%New().Listen()
Open a second terminal to send a notification :
Do ##class(dc.ipcutils.Manager).Notify("Demo:OnTest",{"Message":"My FirstTest"}.%ToJSON())
Now you see the result in the first terminal:
IRISAPP>Do ##class(dc.observer.BasicListener).%New().Listen()
2023-09-27 20:43:46 + Listening Demo with resourcename ODYzMjAxNTAwNTAwMQ started.
2023-09-27 20:43:46 + Type < ctrl+c > to stop listening.
2023-09-27 20:45:58 = Event received:
{
"Event":"Demo:OnTest",
"EventType":"Demo",
"EventName":"OnTest",
"PIDSource":"710",
"Timestamp":"2023-09-27 20:45:58",
"Context":{
},
"Data":"{"Message":"My FirstTest"}"
}