Giter Site home page Giter Site logo

Singleton connections about xible HOT 7 OPEN

ywadi avatar ywadi commented on May 24, 2024
Singleton connections

from xible.

Comments (7)

steve2507 avatar steve2507 commented on May 24, 2024

There is a way to make an output act as 'global', as per the docs. Simply double click the output, and all inputs consuming that type will automatically be connected, without cluttering the UI. Only when you hover a global output, or related input, will the connectors visualize.

See below for an example.

  • Within the mongodb node, the mongodb output is set as global, and the mouse is hovering that output (hence you see the connections)
  • Both mongodb.collection nodes have their collections output set as global, automatically connecting them to the mongodb.collection.insert/collections input. Hovering either output or input would visualize the connections just like the mongodb/mongodb output which is currently highlighted.
    xible_global_ex

Let me know if that answers your question!

And yes, the docs definitely need at least a screenshot on this :-)

from xible.

ywadi avatar ywadi commented on May 24, 2024

Thanks for your response @steve2507 ,
This kind of works for each workflow, let me put it this way, if you have multiple workflows then we will have multiple connections to the mongodb database if each workflow has the mongodb connection node, which is not the best practice in this case for performance on both end (the db and xible) as this will have multiple open connections.
I was assuming the ability to create 1 mongodb connection that can be shared between multiple workflows, so a global connection to all workflows where the connection object can be shared.
Hope that clarifies it? If this is something that you aim to add to xible, I dont mind contributing on that front.

from xible.

steve2507 avatar steve2507 commented on May 24, 2024

Yeah any thoughts on this would be appreciated. Back when I used Xible for home automation, I had a similar 'issue' and was thinking about creating a separate 'global flow' or something like that to store nodes which are exposed to every flow available.

from xible.

ywadi avatar ywadi commented on May 24, 2024

Update: This wont work below as I noticed each flow runs a different PID, wont be able to share singleton objects, just keeping the below for inspiration for other ideas

A suggestion would be that the node that has been created that will be "connecting to a server or serving a global connection" would contain an executable file defined in the structure and the execution of this code returns an object (server connection for example) as a singleton. EXAMPLE:
Mongodb connect to server node will contain the following;

  • Structure File : Add description somehow that it will contain connection defs. that are generated as an object form the editor "Many connection types that can be used on multiple nodes" which would contain as an example ("server host, port, username, password")
  • Index.js File :
  • SingletonDefinitions.js "Need a better name" : Which will contain the ability to load the configurations defined on the editor as an object, executed and saved as a singleton.

when using this node, the user will have a dropdown list asking which configuration it would use (the predefined configurations).

Might be tricky to explain in text for now but do you get the gist of it ?

from xible.

steve2507 avatar steve2507 commented on May 24, 2024

You already concluded this I see, but indeed every flow runs as its own process to not hinder each other in the case of computational intensive tasks. This will also allow for clustering a Xible setup later versions.

I do believe what you need is possible, without any extra development from a nodepack developer, simply by letting a Xible user define some nodes (such as the mongodb one) in a central place.

from xible.

ywadi avatar ywadi commented on May 24, 2024

Would you have a suggestion on how to proceed with that ?
The multi-process approach makes total sense

from xible.

steve2507 avatar steve2507 commented on May 24, 2024

Yes, I think so.
I'm currently working on a solution where a flow can import any other flow (the flow definition, not a flow instance). This would make it possible to simply store connection nodes and such in one flow and include that flow in others.
A next step would be to make a special place available for a 'global' flow that by default is included in all flows.

from xible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.