@@ -338,6 +338,7 @@ def subscribe_module_change(
338
338
passive : bool = False ,
339
339
done_only : bool = False ,
340
340
enabled : bool = False ,
341
+ update : bool = False ,
341
342
filter_origin : bool = False ,
342
343
private_data : Any = None ,
343
344
asyncio_register : bool = False ,
@@ -372,6 +373,8 @@ def subscribe_module_change(
372
373
:arg enabled:
373
374
The subscriber wants to be notified about the current configuration
374
375
at the moment of subscribing.
376
+ :arg update:
377
+ The subscriber wants to be called before the configuration is applied.
375
378
:arg filter_origin:
376
379
Filter events on the originator side to unburden the subscriber, but
377
380
results in 0 value for filtered-out changes in the subscriber infos.
@@ -410,6 +413,7 @@ def subscribe_module_change(
410
413
passive = passive ,
411
414
done_only = done_only ,
412
415
enabled = enabled ,
416
+ update = update ,
413
417
filter_origin = filter_origin ,
414
418
)
415
419
@@ -464,6 +468,7 @@ def subscribe_module_change_unsafe(
464
468
passive : bool = False ,
465
469
done_only : bool = False ,
466
470
enabled : bool = False ,
471
+ update : bool = False ,
467
472
filter_origin : bool = False ,
468
473
private_data : Any = None ,
469
474
asyncio_register : bool = False ,
@@ -499,6 +504,8 @@ def subscribe_module_change_unsafe(
499
504
:arg enabled:
500
505
The subscriber wants to be notified about the current configuration
501
506
at the moment of subscribing.
507
+ :arg update:
508
+ The subscriber wants to be called before the configuration is applied.
502
509
:arg filter_origin:
503
510
Filter events on the originator side to unburden the subscriber, but
504
511
results in 0 value for filtered-out changes in the subscriber infos.
@@ -531,6 +538,7 @@ def subscribe_module_change_unsafe(
531
538
passive = passive ,
532
539
done_only = done_only ,
533
540
enabled = enabled ,
541
+ update = update ,
534
542
filter_origin = filter_origin ,
535
543
)
536
544
check_call (
@@ -1659,6 +1667,7 @@ def _subscribe_flags(
1659
1667
enabled = False ,
1660
1668
oper_merge = False ,
1661
1669
filter_origin = False ,
1670
+ update = False ,
1662
1671
):
1663
1672
flags = 0
1664
1673
if no_thread :
@@ -1669,6 +1678,8 @@ def _subscribe_flags(
1669
1678
flags |= lib .SR_SUBSCR_DONE_ONLY
1670
1679
if enabled :
1671
1680
flags |= lib .SR_SUBSCR_ENABLED
1681
+ if update :
1682
+ flags |= lib .SR_SUBSCR_UPDATE
1672
1683
if oper_merge :
1673
1684
flags |= lib .SR_SUBSCR_OPER_MERGE
1674
1685
if filter_origin :
0 commit comments