|
From: | Hanna Reitz |
Subject: | Re: [PATCH 03/15] python/aqmp: Return cleared events from EventListener.clear() |
Date: | Fri, 17 Sep 2021 14:36:35 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 17.09.21 07:40, John Snow wrote:
This serves two purposes: (1) It is now possible to discern whether or not clear() removed any event(s) from the queue with absolute certainty, and (2) It is now very easy to get a List of all pending events in one chunk, which is useful for the sync bridge. Signed-off-by: John Snow <jsnow@redhat.com> --- python/qemu/aqmp/events.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Not sure if `clear` is an ideal name then, but `drain` sounds like something that would block, and `drop` is really much different from `clear`. Also, doesn’t matter, having Collection.delete return the deleted element is a common thing in any language’s standard library, so why not have `clear` do the same.
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
[Prev in Thread] | Current Thread | [Next in Thread] |