From 4a7f3899c18e9a932aaf04d5f4c49628052c4e9f Mon Sep 17 00:00:00 2001 From: Masashi Umezawa Date: Tue, 17 Sep 2024 23:39:53 +0900 Subject: [PATCH] Added #pendingListIdleMoreThan:limit: to RsStreamConsumerGroup --- .../RsStreamConsumerGroup.class/instance/consumersInfo.st | 4 +++- .../instance/pendingListIdleMoreThan.limit..st | 3 +++ .../RsStreamConsumerGroup.class/instance/pendingsAfter.on..st | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingListIdleMoreThan.limit..st diff --git a/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/consumersInfo.st b/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/consumersInfo.st index fb9efed..70e8ae2 100644 --- a/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/consumersInfo.st +++ b/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/consumersInfo.st @@ -1,3 +1,5 @@ consumers consumersInfo - ^ self endpoint xInfoConsumers: self streamName group: self name \ No newline at end of file + | consumersInfo | + consumersInfo := self endpoint xInfoConsumers: self streamName group: self name. + ^ consumersInfo inject: Dictionary new into: [ :sum :each | sum at: each name put: each; yourself ] \ No newline at end of file diff --git a/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingListIdleMoreThan.limit..st b/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingListIdleMoreThan.limit..st new file mode 100644 index 0000000..62161aa --- /dev/null +++ b/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingListIdleMoreThan.limit..st @@ -0,0 +1,3 @@ +accessing-pending-list +pendingListIdleMoreThan: milliseconds limit: count + ^ self endpoint xPending: self streamName group: self name start: RsStreamMessageId min end: RsStreamMessageId max count: count minIdleMilliseconds: milliseconds \ No newline at end of file diff --git a/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingsAfter.on..st b/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingsAfter.on..st index 1b35ea6..dceff86 100644 --- a/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingsAfter.on..st +++ b/repository/RediStick-Stream-Objects.package/RsStreamConsumerGroup.class/instance/pendingsAfter.on..st @@ -1,6 +1,6 @@ reading pendingsAfter: latestMessageId on: consumerName - ^ self wrapAsAcceptableEntries: ( self endpoint + ^ self wrapAsAcceptableEntries: (self endpoint xGroupRead: self streamName id: latestMessageId group: self name