Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comet: decouple Derivatives from Characterization #5778

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Conversation

no-reply
Copy link
Contributor

the tight coupling of Derivative generation to the Characterization background
job makes it hard to customize derivatives processing without changing
characterization behavior.

this takes a hack at decoupling the two by routing derivatives through an event
handler. instead of enqueing the derivatives job directly, the CharacterizeJob
now simply reports that it has characterized the given file_id within the
file_set. it also provides its path hint, in case a listener wants to log or
reuse that hint.

we then add a listener to do the work of actually characterizing. this is a bit
of indirection, but has a lot of benefits in flexibility: you no longer need to
rewrite characterization behavior to customize derivatives handling.

@samvera/hyrax-code-reviewers

@@ -119,6 +119,10 @@ class Publisher
# unique id), AND a `:user` (the ::User responsible for the update).
register_event('collection.membership.updated')

# @since 3.5.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i plan to backport this quickly to the 3.x stable branch, so this is the appropriate release target

the tight coupling of Derivative generation to the Characterization background
job makes it hard to customize derivatives processing without changing
characterization behavior.

this takes a hack at decoupling the two by routing derivatives through an event
handler. instead of enqueing the derivatives job directly, the CharacterizeJob
now simply reports that it has characterized the given file_id within the
file_set. it also provides its path hint, in case a listener wants to log or
reuse that hint.

we then add a listener to do the work of actually characterizing. this is a bit
of indirection, but has a lot of benefits in flexibility: you no longer need to
rewrite characterization behavior to customize derivatives handling.
@no-reply no-reply merged commit 0cdb459 into main Jul 14, 2022
@no-reply no-reply deleted the decouple-char-deriv branch July 14, 2022 20:30
no-reply pushed a commit to surfliner/surfliner-mirror that referenced this pull request Jul 19, 2022
this event was introduced in samvera/hyrax#5778; but we haven't yet been able to
backport it. introduce it here until it can get into the 3.x line.
no-reply pushed a commit to surfliner/surfliner-mirror that referenced this pull request Jul 19, 2022
publish jobs when files are characterized, per samvera/hyrax#5778.

when these jobs are published, check if the characterized file is a
pcdm:OriginalFile. if so, enqueue a derivatives job; else do nothing.
dlpierce added a commit that referenced this pull request Aug 16, 2022
@dlpierce dlpierce added the notes-minor Release Notes: Non-breaking features label Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-minor Release Notes: Non-breaking features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants