Add events when items are added/removed from a queue

Created on 17 June 2022, over 2 years ago
Updated 4 May 2023, over 1 year ago

Problem/Motivation

When a queue's items are manipulated it would good to have an event fire so that other code can react to changes to the queue. The normal entity update or changed is triggered for all changes to a queue (e.g. title, other fields, settings). I would be helpful to have one that is changes to the items specificially.

Proposed resolution

Add events for add item and remove item.

API changes

Two new events

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇨🇦Canada minoroffense Ottawa, Canada

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • achap 🇦🇺

    It's possible that items were removed even if the queue stayed the same size or new items were added. It would probably be better to compare the original items with the new items, and if any that are in old items are not in new items, dispatch a removed event with those items, and any that are in new items that are not in old items dispatch an added event with those items.

  • Status changed to Needs work over 1 year ago
  • 🇷🇴Romania amateescu

    @achap is right, we can't rely on the queue size to determine the changes that happened.

Production build 0.71.5 2024