Git Product home page Git Product logo

Comments (4)

jasonacox avatar jasonacox commented on July 20, 2024

Lines 110-112 appear to redefine ThreadingHTTPServer

That's a class override to inject daemon_threads = True but I'll need to investigate when I get some time. Are you seeing any odd behavior?

Thanks @BuongiornoTexas .

from pypowerwall.

BuongiornoTexas avatar BuongiornoTexas commented on July 20, 2024

I'm not seeing any odd behaviour.

But isn't line 110 re-declaring rather than over-riding ThreadingHTTPServer? That is, this creates a new class type inheriting from HTTPServer and ThreadingMixIn (i.e. discarding the imported definition and replacing it with the new class). That's certainly the warning I'm getting from mypy.

Your declaration should give the same result as the import - I checked the library module, and the definition of the imported ThreadingHTTPServer is the same as your redeclaration.

class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
    daemon_threads = True

So not an issue now, just an oddity.

from pypowerwall.

BuongiornoTexas avatar BuongiornoTexas commented on July 20, 2024

I just did what I should of have done in the first place and tested commenting out lines 110-112. From a quick and dirty check, it looks as though the server operates as expected - in particular threads fire up and don't block.

Given I've gone a PR for ToU that includes minor changes to server.py, are you happy for me to roll this into that PR?

from pypowerwall.

jasonacox avatar jasonacox commented on July 20, 2024

Yes, please do!

from pypowerwall.

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.