Giter Site home page Giter Site logo

Comments (2)

rfdonnelly avatar rfdonnelly commented on August 25, 2024 1

The nice (bad?) thing about Ruby is that you can monkey patch existing classes. In other words, a plugin could modify the Jobrnr::Job::Instance class to add a metadata object.

I agree it would be nice to have an official way to do this. However, I foresee many complications/tradeoffs that would need to be addressed. For example, if plugin A generates metadata on some event and plugin B expects to use that metadata on the same event, how do you ensure that plugin B receives the event after plugin A? This could be solved in various ways but at the cost of complexity.

I don't currently have a need for this but I like the idea. Can revisit if a use case presents itself. Thank you for the suggestion.

from jobrnr.

ahdel-r avatar ahdel-r commented on August 25, 2024

Cool - didn't know about the monkey patch feature.
And yes, all use cases I've seen this useful for do not exist within the same event. Typically some information was picked up at an earlier event (e.g. job definition modification for use in the job instance), then the information was used at later event stages or for post application reporting of metrics (e.g. some information regarding the job instance or job reported in stats or pointers for various improvements to the user experience). Things do become complex if the data needs to be shared within the same event between plugins, but that could be solved a number of ways as you mentioned.

Essentially, some sort of metadata passing interface between plugins for extensibility and scalability is nice if the use case presents itself. It is hard for me to present this from a requirements perspective thought right now without an explicit general use case rather than a proprietary one. If I come up with one, I'll let you now.

from jobrnr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.