WebHare community

Multiple WRD event listeners

I have a backend with these event listeners to update the main list upon changes:

    ^wrdeventlistener->masks := wrdschema->^selling_process->GetEventMasks()
                         CONCAT wrdschema->^sellable_object->GetEventMasks()
                         CONCAT wrdschema->^dealer->GetEventMasks()
                         CONCAT wrdschema->^wrd_person->GetEventMasks();

But if there’s a new subscription, 3 of these 4 objects get changed, which results in 3 list refreshes.

Is there a way to listen to ‘a’ change within a WRD schema instead of by type? Or do I need to implement my own broadcasts/events for this?

Why not set groupinterval on the event listener so it can combine the events into one refresh ?

Because I didn’t know it exists :slight_smile:

It seems to only work partly, though. In my frontend, there’s a couple of CreateEntity/UpdateEntity calls that indeed only trigger one refresh when using groupinterval.

However, the backend uses these:

    ^selling_process->StoreEntity(work, extradata);

Those still trigger the refresh twice, even with groupinterval.

Which is kinda weird, since it seems all StoreEntity does is collect fields and also call Create/Update Entity.

Validated a couple of times: if I remove one of the StoreEntity calls, I see only 1 refresh. When having both, there’s 2 refreshes.

if the groupinterval isn’t too short, then it sounds like a bug.

Nah, set to 5000, should be more than enough I guess. The 2nd refresh occurs pretty much instantly after the 1st.