Refactoring
See original GitHub issueIssue Description
huey.consumer.Consumer.worker_threads
right now is a list of tuples (worker, process)
.
But the first item is never used, because it is recreated each time ( https://github.com/coleifer/huey/blob/0447c6046e7475ec31e9d0796ccc6c7f906bfaef/huey/consumer.py#L589 ). worker_threads
can be a list of processes instead to make the code simpler to understand and maintain.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Refactoring
Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.
Read more >clean your code - Refactoring.Guru
Refactoring is the controllable process of systematically improving your code without writing new functionality. The goal of refactoring is to pay off ...
Read more >Code refactoring - Wikipedia
In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the factoring—without changing ...
Read more >What is Refactoring (Code Refactoring)? - TechTarget
Refactoring is the process of restructuring code, while not changing its original functionality. The goal of refactoring is to improve internal code by ......
Read more >Refactoring - Martin Fowler
Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series of small behavior-preserving ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I suggested the same thing here https://github.com/coleifer/huey/issues/265#issuecomment-337261204
But you suggested to use an uglier way. So I made the conclusion that you don’t want to make it easier to override the internals.
Sorry, I am not a native English speaker, so I am not sure what this idiom means. But I think I understand what you mean.
I feel like I am fighting with you. To me it looks like you oppose some of changes. I kind of understand why, but I don’t think it’s wise.
That’s were my attitude comes from.
So I think I could address the same quote to you… 😃
You’re correct. It makes things like testing easier to have the worker class and the associated process in the same data-structure, because once you wrap the worker class in a greenlet/thread/process, there’s no way to reference it after the fact. It’s not being used outside of the tests, at present, though. Perhaps I can make some better comments.