Closed Liviu-Ionel-Anton closed 3 months ago
Hi Liviu,
Calling Publish will return a PublishResponse with data changes for any subscription, as you found. You could build a map of channels to communicate the notification messages to the correct handler goroutine. One chan for each subscription.
mu sync.RWMutex // protect subscribers.
subscribers map[uint32]chan NotificationMessage //map of channel, indexed by subID.
Hi Andrew,
It worked by centralising the publish requests/responses.
Thanks!
Hi Andrew,
I have the following scenario: several subscriptions for the same server and each subscription is handling its monitored items in its own goroutine. The problem is that I'm receiving from one subscription to another subscription (I'm checking this by subscription Id). I've oversimplified the scenario by using the sample from the src and attached the file. I've tested it also using UAExpert demo server and ProSys sim server, and it's the same.
Any suggestions on how to fix this? run.go.zip