File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717import zenoh
1818
1919
20- def on_matching_status_update (status : zenoh .MatchingStatus ):
21- if status .matching :
22- print ("Publisher has matching subscribers." )
23- else :
24- print ("Publisher has NO MORE matching subscribers" )
25-
26-
2720def main (
2821 conf : zenoh .Config ,
2922 key : str ,
@@ -41,6 +34,13 @@ def main(
4134 pub = session .declare_publisher (key )
4235
4336 if add_matching_listener :
37+
38+ def on_matching_status_update (status : zenoh .MatchingStatus ):
39+ if status .matching :
40+ print ("Publisher has matching subscribers." )
41+ else :
42+ print ("Publisher has NO MORE matching subscribers" )
43+
4444 pub .declare_matching_listener (on_matching_status_update )
4545
4646 print ("Press CTRL-C to quit..." )
Original file line number Diff line number Diff line change 1818import zenoh
1919
2020
21- def on_matching_status_update (status : zenoh .MatchingStatus ):
22- if status .matching :
23- print ("Querier has matching queryables." )
24- else :
25- print ("Querier has NO MORE matching queryables" )
26-
27-
2821def main (
2922 conf : zenoh .Config ,
3023 selector : str ,
@@ -46,6 +39,13 @@ def main(
4639 )
4740
4841 if add_matching_listener :
42+
43+ def on_matching_status_update (status : zenoh .MatchingStatus ):
44+ if status .matching :
45+ print ("Querier has matching queryables." )
46+ else :
47+ print ("Querier has NO MORE matching queryables" )
48+
4949 querier .declare_matching_listener (on_matching_status_update )
5050
5151 print ("Press CTRL-C to quit..." )
You can’t perform that action at this time.
0 commit comments