Skip to content
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

pyln: Add a dynamic configs and a callback for changes #7289

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented May 3, 2024

This is an alternative to #7288, that uses a callback per config
option rather than hooking the setconfig function entirely. This
allows us to react to individual config options changing, while still
maintaining the default setconfig behavior.

@cdecker cdecker force-pushed the 202405-pyln-setconfig-condition branch from 3a54f18 to c10e1a9 Compare May 3, 2024 16:47
@cdecker
Copy link
Member Author

cdecker commented May 3, 2024

I'd love feedback from @rustyrussell and @CGuida on this since it is an alternative to #7288

@rustyrussell
Copy link
Contributor

rustyrussell commented May 9, 2024

Fixed commit message on "fix..." commit.

@rustyrussell rustyrussell reopened this May 9, 2024
@rustyrussell rustyrussell force-pushed the 202405-pyln-setconfig-condition branch from d7ea1c7 to 0df80c6 Compare May 10, 2024 05:26
@rustyrussell
Copy link
Contributor

Fixed 'default: null' which cln doesn't like on flag values (if you specify a default, it must be false).

rustyrussell and others added 5 commits May 23, 2024 12:47
We didn't actually *change* the value you'd see, when we got a setconfig call!

Changelog-Added: pyln-client: implement setconfig hook for plugins so you can see changes in `dynamic` options.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
I was looking into using the `threading.Condition` but since we're
already rather heavily using callbacks, this allows us to stay
single-threaded, and not having to completely hook the `setconfig`
function.

Changelog-Added: pyln-client: Added a notification mechanism for config changes
And don't set the value unless it passes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
[ Fix not to include 'value' and 'default' (if None) in getmanifest response --RR ]
@cdecker cdecker force-pushed the 202405-pyln-setconfig-condition branch from 0df80c6 to 6cc8d43 Compare May 23, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants