Class: HyraxListener

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/hyrax/templates/app/listeners/hyrax_listener.rb

Overview

Generated by hyrax:listeners

The Hyrax engine uses a publish/subscribe programming model to allow pluggable behavior in response to certain repository events. A range of events are published on a topic based event bus.

This listener provides a template.

For simple use cases, it’s fine to add behavior to the ‘#on_*` methods in this Listener. If you have more than trivial behavior here, you probably want to add new classes that are named narrowly scoped and named for what the listener is for.

When writing listener methods, it’s important to carefully consider error, handling. Unhandled exceptions short-circuit behavior for other listeners, so it’s a good idea to be paying attention to failure cases.