-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup modes for context builder #96
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mandelsoft
force-pushed
the
mandelsoft/private
branch
from
September 3, 2022 21:04
ba3e219
to
e7d573c
Compare
Skarlso
reviewed
Sep 5, 2022
yitsushi
reviewed
Sep 5, 2022
yitsushi
reviewed
Sep 5, 2022
Skarlso
reviewed
Sep 5, 2022
@phoban01 You have pull request review open invite, please check |
Skarlso
reviewed
Sep 6, 2022
@mandelsoft You need rebase this pull request with latest master branch. Please check. |
Skarlso
previously approved these changes
Sep 6, 2022
yitsushi
previously approved these changes
Sep 6, 2022
mandelsoft
force-pushed
the
mandelsoft/private
branch
from
September 8, 2022 13:34
7c9e7ef
to
4d8c268
Compare
rebased and linted |
@phoban01 You have pull request review open invite, please check |
Skarlso
approved these changes
Sep 9, 2022
yitsushi
approved these changes
Sep 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Support different setup modes for context creation.
<context package>.New()
by default, now creates a complete fresh context graph, using the default handler registries.Additionally, it accepts an optional parameter with the intended setup mode. It relates to all settings not explicitly configured with appropriate
With*
methods:MODE_SHARED
: the original mode creates a new local context sharing the rest from the default context graphMODE_DEFAULTED
: creates a decoupled graph, but reuses the default handler registries.MODE_CONFIGURED
: creates a decoupled graph, with own registries initialized with the actual settings of the default ones.MODE_INITAL
: creates a decoupled graph with empty handler registries.The typical use case to create any number of functional contexts on demand, should be the mode
MODE_DEFAULTED
, which is the default mode for the buildersNew
methods, now.It assure a new, independent environment, featuring all the capabilities of the library, but ready for a new local configuration. For example with credentials, or other specific settings, and with own local caches stored in the context attributes.
If dedicated handlers should be registered for a temporary environment, the mode
MODE_CONFIGURED
must be usedto avoid the pollution of other context graphs. It provided the standard handlers provided by the default registrations, but
provided local handler registries in the context graph.
As before, dedicated, explicitly configured environments can be composed with the context builders. The setup mode
is used in addition, to decide how to fill the gaps in the configured graph, not explicitly configured by the builder settings.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: