Comments (2)
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.
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)
- Jobs run with a failing parent if at least one other parent passes
- Add version
- Stack trace on bad option
- Add per job timeout
- Add Plugin and Script Specific Exceptions
- Add a DSL for the plus option parser
- Add `--dry-run` option
- Add graceful terminate on ctrl-c
- Add option to customize log recycling
- Remove use of deprecated Fixnum HOT 1
- Add comparison to GNU Make to README
- Investigate making runs reproducible
- job::repeat 0 causes infinite loop
- Document seed substitution
- Errno::ESRCH on 3rd Ctrl-C HOT 1
- --version uses Git SHA1 from wrong repository
- Stack trace on early Ctrl-C
- Capture stderr of jobs HOT 2
- Typo in man page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jobrnr.