Add support for multiple queue databases in a single app #352
Labels
@joystick.js/cli
Related to the @joystick.js/cli package.
@joystick.js/node
Related to the @joystick.js/node package.
refactor
Something to improve
I made shortsighted move in respect to queues. I currently limit an app to one
queues
database via the config, but there could be a scenario where you want to target different databases for different queues.Proposal I came up with is to add a
database
option to queue definitions like this:Internally, Joystick would check to see if this value is defined. If it is, it would set the target database to that provider/database name combo. If it's not set, it would default back to what it is now (just use the database with
queues: true
set).Only thing I don't like is that it could get confusing to have both options. May be worth forcing database specification instead of the
queues: true
thing. Problem there is if I only have one database, I wouldn't have aname
(that only applies when I have multiple db connections for the same provider). That could be mitigated by checking internally to see if there are multiples of the specified provider and if not, just get the first one (and if there are, check for the specificied name).The text was updated successfully, but these errors were encountered: