enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Inspect (multi)repoconnection sources/repoId/branch property #6738

Closed ComLock closed 5 years ago

ComLock commented 6 years ago

In order to (in theory) avoid wasting precious time reconnecting to a repo I pass the connection around.

To make sure I have the correct connection I would like to be able to inspect the connection.

Thus I propose that a connection have two properties:

ComLock commented 6 years ago

Hmm one must take into account multirepoconnection. So perhaps an array of sources.

http://repo.enonic.com/public/com/enonic/xp/docs/6.15.5/docs-6.15.5-libdoc.zip!/module-node.html#.multiRepoConnect

sigdestad commented 5 years ago

So, what are you looking for, like a connection.info()?

ComLock commented 5 years ago

Yes. You could provide a function called info, but JS object can haz properties too. Not everything needs to be a function.

sigdestad commented 5 years ago

Sure, Any input on what it could it look like?

ComLock commented 5 years ago

const connection = connect({branch: 'master'}); log.info(connection.branch); // --> 'master'

sigdestad commented 5 years ago

Having discussed this, there is actually no time spent here - since this "connection" is just a simple object. There are no pools etc.

I think this invalidates your initial problem?

Re-open if we are wrong