This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Avalon Mongo Connection split #136
Labels
type: enhancement
Enhancements to existing functionality
Comments
Let's describe in more detail why we think this is needed and create an issue in avalon-core, as this would heavily affect it. |
This is currently required only because we want use Avalon's mongo connection in pype (in many places all with different context) so it's more our issue which may not be accepted. But if we'll speak about using avalon tools in premiere, photoshop or other hosts without python, and have ability to have multiple opened those hosts at the same time, with one running listening server(rest api, websockets, etc.), then having this feature is one of first steps. I'll think about it. |
Implemented with ynput/avalon-core#187 |
Tilix4
pushed a commit
to Tilix4/OpenPype
that referenced
this issue
Jul 11, 2023
Tilix4
pushed a commit
to Tilix4/OpenPype
that referenced
this issue
Aug 4, 2023
Tilix4
pushed a commit
to Tilix4/OpenPype
that referenced
this issue
Oct 17, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It is required to split avalon's mongo connection out of avalon's Session! This is just practical issue, now we have
io_nonsingleton
but each time new object is created, new connection to mongo is created so one running pype may have 16 connections to mongo. This is too much for single application accessing the same data but from different table (collection).Idea of implemetation:
1.) Singleton object caring only about connecting to Mongo DB. Let's call it
AvalonMongoDB
2.) Class
AvalonMongoConnection
which can hold context. Let's call the context atttributeSession
for backwards comaptibility.3.)
AvalonMongoDB
should be used as currentavalon.io
so by default has one stored object ofAvalonMongoConnection
it'sSession
is filled with environments and is stored toavalon.api
.4.) At the same time
AvalonMongoDB
should have method likeget_mongo_connection
which returns newAvalonMongoConnection
object with unfilledSession
.5.) This connection has it's own context but is using the same connection. Methods like
install
anduninstall
remains but forAvalonMongoConnection
theinstall
method just mean to trigger creating of connection to mongo inAvalonMongoDB
at the same timeAvalonMongoDB
should store booleans about each instance if the instance is marked as "installed". If all instances are not "installed" then connection to mongo is lost.Let me know what you think, what names for
AvalonMongoDB
andAvalonMongoConnection
would be best and what would you change. With this approach avalon is backwards compatible just adds new feature.The text was updated successfully, but these errors were encountered: