Skip to content

RRingBuffer.clear() method #6964

@Sningning

Description

@Sningning

I used resisson.getRingBuffer("test) to obtain an RRingBuffer, and then used setCapacity(1024) to set the initial capacity. According to the business scenario, sometimes it is necessary to clear all elements in the queue. I attempted to use clear() to clear the elements, but it seems this command also reinitializes the RRingBuffer, causing the following error when using offer() to add elements again: RingBuffer capacity is not defined. Is this by design? If so, what method can be used to only clear the elements without changing the capacity?

Redis version: 6.2.16
Redisson version: 3.52.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions