Giter Site home page Giter Site logo

Comments (5)

asajeffrey avatar asajeffrey commented on September 2, 2024

In particular, for services that take ownership of some parameters, the VRServiceCreator API is not ideal:

let foo_creator = FooServiceCreator::new(this, that);
let foo1 = foo_creator.new_service(); // foo1 now owns this and that
let foo2 = foo_creator.new_service(); // What happens now? panic?

from rust-webvr.

jdm avatar jdm commented on September 2, 2024

The only reason I can see for its existence is for this code, but it's not clear to me that that abstraction is necessary.

from rust-webvr.

asajeffrey avatar asajeffrey commented on September 2, 2024

Indeed, why not keep an array of VRService objects rather than VRServiceCreator objects?

from rust-webvr.

MortimerGoro avatar MortimerGoro commented on September 2, 2024

It's used to register services based on cargo features and in order to do lazy initialization (only initialize services when first requested from JavaScript thread, otherwise some system UI may trigger (e.g Steam VR state UI on HTC Vive).

I think we could switch to a VRService array as long as we mantain a lazy initialization

from rust-webvr.

asajeffrey avatar asajeffrey commented on September 2, 2024

The VRService doesn't need to do any initialization until initialize is called, which won't happen until JS fetches the displays or gamepads.

from rust-webvr.

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.