Problem/Motivation

Hello!

In an effort to reduce duplicate queue items we have extended the DatabaseQueue plugin in #3379798: Alternative approach to unique queue using upsert - and as part of the implementation we set item_id as a hash of the data so that we can use an upsert query when adding items to the queue.

Part of that implementation involved duplicating several methods in the plugin in order to remove the casting of item_id to an integer.

To make it easier to extend this plugin - can this casting be dropped? As far as I can see there are example tests with non integer based item items and the tests pass without it. Otherwise, perhaps we can introduce a small helper method such as castItemId that we can override. Our aim is to reduce code duplication since we have had to extend claimItem, claimItemMultiple, selectPage and releaseItemMultiple.

Steps to reproduce

See code duplication in #3379798: Alternative approach to unique queue using upsert

Proposed resolution

TBC

Remaining tasks

Agree on approach

Issue fork purge-3475680

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ericgsmith created an issue. See original summary.

ericgsmith’s picture

Status: Active » Needs review

Added MR to drop the casting - setting to Needs review for feedback.

As mentioned in the issue summary, open to other ideas that will allow us to reduce the code duplication in our extending plugin.