Git Product home page Git Product logo

Comments (4)

ascandella avatar ascandella commented on May 15, 2024

Do you have a use case for the type? I realize it's a bit awkward, but this only exists so we have a hook to register uber-datacenter-internal dispatcher logic, which our users should never know about / care about / see

from fx.

yichengq avatar yichengq commented on May 15, 2024

I don't have one, but I still feel that they should be public. If we have use cases inside our datacenter, this sounds sufficient proof that it could be used by other developers too. The function has already been public, and hiding input parameter type cannot avoid people using it.

For "our users should never know about / care about / see", I totally agree and this gonna be a general pattern. I could foresee that all modules would need uber-specific logic at least for metrics and tracing. If we continue with this approach, it means that all module packages would have a global controller and a public function to register it. I think this may overuse global structs, and building customized dispatcher while ModuleCreateFunc is more native.

I don't have a good solution though. Maybe we need an internal version which includes uber-specific logic as default. :(

from fx.

 avatar commented on May 15, 2024

I think Aiden meant why we need Register functions :)

As per function types, it doesn't really matter:
https://golang.org/ref/spec#Type_identity

Two function types are identical if they have the same number of parameters and result values, corresponding parameter and result types are identical, and either both functions are variadic or neither is. Parameter and result names are not required to match.

So yeah, for consistency we should make them public

from fx.

 avatar commented on May 15, 2024

#247

from fx.

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.