-
Notifications
You must be signed in to change notification settings - Fork 87
Conversation
🤖 zincr found 0 problems , 1 warning
Details on how to resolve are provided below Large CommitsChecks all commits for large additions to a single file. Large commits should be reviewed more carefully for potential copyright and licensing issues This file contains a substantial change, please review to determine if the change comes from an external source and if there are any copyright or licensing issues to be aware of
|
🤖 zincr found 1 problem , 1 warning
Details on how to resolve are provided below ApprovalsAll proposed changes must be reviewed by project maintainers before they can be merged Not enough people have approved this pull request - please ensure that 1 additional user, who have not contributed to this pull request approve the changes.
Large CommitsChecks all commits for large additions to a single file. Large commits should be reviewed more carefully for potential copyright and licensing issues This file contains a substantial change, please review to determine if the change comes from an external source and if there are any copyright or licensing issues to be aware of
|
This pull request introduces 2 alerts when merging d94070f into aa80d5a - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some wording nits in the docs. Feel free to ignore if you'd rather merge now. nvm :D
with a watching request will exist before terminating from the **client** side. | ||
The default is forever (``None``). | ||
|
||
``settings.watching.stream_timeout`` (seconds) is how long the session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have never guessed that from the names. How about session_client_timeout
and session_server_timeout
?
Configuration | ||
============= | ||
|
||
There are tools to configure some of kopf functionality, like asynchronous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Tools" makes me think of things like cmdline programs. How about "It is possible to configure..."?
Startup configuration | ||
===================== | ||
|
||
Every operator has its settings (even if there are more than one operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grammar nit: I'd word it as "... even if there is more than one operator in the same process ..."
==================== | ||
|
||
``settings.execution`` allows to set a number of synchronous workers used | ||
and redefined the asyncio executor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "redefines", otherwise the sentence might first be parsed as "number of synchronous workers used and redefined".
Or even better, find a different word for "redefines" since that suggests the implementation of the executor is changed when I think it just gets reconfigured or maybe another object is instantiated with different parameters?
I would also change "a number" to "the number". With the former the sentence can be misunderstood as "some of the synchronous workers are somehow changed". (This is really grammar nitpicking. I expect most people who read this will know what it means as is.)
which defines the operator's behaviour. See also: `kopf.OperatorSettings`. | ||
|
||
It can be modified if needed (usually in the startup handlers). Every operator | ||
(if there are more than one in the same process) has its own config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if there is more than one
@haikoschol Thank you. I've implemented these recommendation with few little additions in #337. |
What do these changes do?
Introduce settings: an official and documented way of configuring of all the little aspects of the framework behaviour on a per-operator basis.
Description
Previously, module-level hacks were used to modify global variables grouped into classes-as-namespaces (beside being undocumented):
No more!
Settings are now a part of the framework, and should be defined in the startup handlers:
And there are many more settings (migrated from the existing config classes), and all the new settings will be added to this structure (e.g. a state persistence storage from #331).
Backward-compatibility
The legacy way via module-level config-classes is supported — they are used as the defaults for the settings. BUT: runtime changes of the config-classes are ignored, only the runtime changes of the settings are obeyed.
A special case with the executor of synchronous handlers is supported, and calls to
set_synchronous_tasks_threadpool_limit()
are forwarded to the settings executor — until config-classes are removed with the next major release (1.0).Beside exposing settings to the users officially, this change also adds a dependency injection mechanics which can be used in the tests instead of mocks — thus making the tests cleaner.
Issues/PRs
Type of changes
Checklist
CONTRIBUTORS.txt