-
Notifications
You must be signed in to change notification settings - Fork 912
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
pyln: Add a dynamic configs and a callback for changes #7289
Conversation
3a54f18
to
c10e1a9
Compare
I'd love feedback from @rustyrussell and @CGuida on this since it is an alternative to #7288 |
a80ef6c
to
e23bc63
Compare
e23bc63
to
d7ea1c7
Compare
Fixed commit message on "fix..." commit. |
d7ea1c7
to
0df80c6
Compare
Fixed 'default: null' which cln doesn't like on flag values (if you specify a default, it must be false). |
0df80c6
to
6cc8d43
Compare
6cc8d43
to
2b76ae3
Compare
Trivial rebase on master to re-run tests, and move one part of commit to make flake8 happy with each commit. Ack 2b76ae3 |
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>
2b76ae3
to
7f1226c
Compare
Oh, we broke our own plugins which use plugin.option['optname']['value'] instead of get_value like I guess they're supposed to. Fix that so we don't break other plugins! |
[ Fix not to include 'value' and 'default' (if None) in getmanifest response --RR ] [ Fix to support [] operator for existing plugins (including our test ones!) --RR ]
Noticed as I was debugging. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7f1226c
to
fa8b6aa
Compare
This is an alternative to #7288, that uses a callback per config
option rather than hooking the
setconfig
function entirely. Thisallows us to react to individual config options changing, while still
maintaining the default
setconfig
behavior.