I created a 'queue' package (like in Laravel), which uses a Message Queue (Beanstalk, etc) to free up the application fronted from running a lot of code.
The queue executes a job class, which always extends a class called 'Job'. The problem is that the package requires to have a queue software installed on the server which is not always an option, so my code has to be able tor run without the queue package.
This is true for code wrapped in a package as well, not only for frontend code. i don't really like making dependencies between packages (except special cases like Ormauth).
So my solution would be to run only the job class with the given argument, and only use queue package, when it is available.
The problem is that these job classes extends a base class called 'Job', which is now in the queue package.
My question is: Where to put this Job class? The easiest way would be pushing the Job class to the fuel core, but I do not know whether this class could be part of the core. Other possibilities: put it in the application when I need it, but it in a base package which is always loaded.
Changing the core is always a bad idea, it should not be touched.
If you see it as a core extension, and you need modularity or re-use for other applications, a separate package is the way to go. Your queue package could do a \Package::load() of this package in its bootstrap so you only have to load 'queue' to make it working.