summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorDonald Hunter <donald.hunter@gmail.com>2024-11-13 12:08:43 +0300
committerJakub Kicinski <kuba@kernel.org>2024-11-15 05:09:06 +0300
commit8aefcfa04beaab070a2009828da40bdd4888eee6 (patch)
tree524f0b3b6b7d50d38898f3f8fcf5e1fe4ce3286f /tools/perf/scripts/python/exported-sql-viewer.py
parentcef009cc4a76c5bfd28d68eab2b3273243fddcdc (diff)
downloadlinux-8aefcfa04beaab070a2009828da40bdd4888eee6.tar.xz
tools/net/ynl: add async notification handling
The notification handling in ynl is currently very simple, using sleep() to wait a period of time and then handling all the buffered messages in a single batch. This patch adds async notification handling so that messages can be processed as they are received. This makes it possible to use ynl as a library that supplies notifications in a timely manner. - Add poll_ntf() to be a generator that yields 1 notification at a time and blocks until a notification is available. - Add a --duration parameter to the CLI, with --sleep as an alias. ./tools/net/ynl/cli.py \ --spec <SPEC> --subscribe <TOPIC> [ --duration <SECS> ] The cli will report any notifications for duration seconds and then exit. If duration is not specified, then it will poll forever, until interrupted. Here is an example python snippet that shows how to use ynl as a library for receiving notifications: ynl = YnlFamily(f"{dir}/rt_route.yaml") ynl.ntf_subscribe('rtnlgrp-ipv4-route') for event in ynl.poll_ntf(): handle(event) Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20241113090843.72917-3-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions