API for configuring drivers
tanner0101 opened this issue · 5 comments
There's a bit of manual work currently required to get a valid JobsPersistanceLayer
. We should provide some convenience APIs for this like FluentKit does.
Each driver can extend those convenience APIs with functions for supplying the required credentials.
Perhaps we could utilize JobsConfiguration
, something like this would be nice:
s.extend(JobsConfiguration.self) { configuration, container in
let job = try ExecutorJob(container)
configuration.add(job)
configuration.configureRedis(hostname: ..., port: ...)
}
But with that wouldn't the main jobs
package have to know that Redis
exists?
@mcdappdev no, JobsConfiguration
would hold just a JobsPersistanceLayer
, then JobsRedisDriver
would extend JobsConfiguration
to add that method
Ahh I see. That could work nicely! Let's plan on doing that.
We need to make sure that we use the provider (or other means) to properly cleanup any connection pools that we create