Comments (9)
It could be specified via mix config, as with the other configuration in Rihanna.
By default it continues to behave as it does today, however this config could be specified like so:
# A named postgrex connection is used
config :rihanna,
enqueue_postgres_connection: {Postgrex, :my_postgrex_connection}
# An Ecto connection pool is used
config :rihanna,
enqueue_postgres_connection: {Ecto, My.Repo}
In either of the above cases the Rihanna.Job.Postgrex
process is not started.
from rihanna.
Interesting idea. From what I understand, this is only for the process that enqueues jobs, is that correct?
from rihanna.
What do you mean? :)
from rihanna.
I mean, it's for Rihanna.enqueue
- not the dispatcher?
from rihanna.
Yes, it's only for enqueuing.
Ecto doesn't offer a way to always request the same connection from the pool so the dispatcher so the advisory locks wouldn't work. I believe it is possible to check out a connection long term with Ecto, but this is effectively the same as having a dedicated Postgrex connection so I'm not sure I see an advantage.
from rihanna.
This seems like a good idea. Feel free to implement :)
from rihanna.
Do you like the config design above?
from rihanna.
Yeah it looks ok.
from rihanna.
It could be passed at runtime for sure.
I suggested that API because Rihanna doesn't currently accept configuration beyond the Postgrex config at runtime so I thought that would be more in keeping with the current API.
from rihanna.
Related Issues (20)
- Postgres error: "you don't own a lock of type ExclusiveLock" HOT 5
- Not execute in test sandbox ? HOT 1
- Running on many apps in an umbrella HOT 6
- Running N instances of rihanna on different tables HOT 2
- UndefinedFunctionError: function nil.id/0 is undefined HOT 3
- Question: Projection on when multi-queue support will be a thing? HOT 8
- Re-enqueue and retain metadata
- Should due_at be part of the order in the lock query? HOT 2
- Rihanna.Jobs documentation issue
- ERROR 25006 (read_only_sql_transaction) cannot execute SELECT FOR UPDATE in a read-only transaction HOT 2
- Returning {:reenqueue, due_at} from job removes job from table HOT 3
- lock optimization for very large jobs table. Possible?! HOT 10
- Report job type (e.g. module name) in Telemetry events HOT 6
- Jobs that unexpectedly raise/exit are never retried HOT 1
- Rihanna Jobs sporadically not appearing in logs HOT 2
- Upgrade checks fail when database has multiple schemas & job tables
- Warnings on 1.11.4
- Rihanna.enqueue_many ? HOT 2
- Option to create the jobs_table_name on a different schema
- Any chance of a version bump / release with the latest changes? HOT 2
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 rihanna.