Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2013-2024 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.api;
import org.redisson.api.stream.*;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Async interface for Redis Stream object.
*
* Requires Redis 5.0.0 and higher.
*
* @author Nikita Koksharov
*
* @param key type
* @param value type
*/
public interface RStreamAsync extends RExpirableAsync {
/**
* Creates consumer group.
*
* Usage examples:
*
* StreamMessageId id = stream.createGroup(StreamCreateGroupArgs.name("test").id(id).makeStream());
*
*
* @param args method arguments object
*/
RFuture createGroupAsync(StreamCreateGroupArgs args);
/**
* Removes group by name.
*
* @param groupName - name of group
* @return void
*/
RFuture removeGroupAsync(String groupName);
/**
* Creates consumer of the group by name.
*
* Requires Redis 6.2.0 and higher.
*
* @param groupName - name of group
* @param consumerName - name of consumer
*/
RFuture createConsumerAsync(String groupName, String consumerName);
/**
* Removes consumer of the group by name.
*
* @param groupName - name of group
* @param consumerName - name of consumer
* @return number of pending messages owned by consumer
*/
RFuture removeConsumerAsync(String groupName, String consumerName);
/**
* Updates next message id delivered to consumers.
*
* @param groupName - name of group
* @param id - Stream Message ID
* @return void
*/
RFuture updateGroupMessageIdAsync(String groupName, StreamMessageId id);
/**
* Marks pending messages by group name and stream ids as correctly processed.
*
* @param groupName - name of group
* @param ids - stream ids
* @return marked messages amount
*/
RFuture ackAsync(String groupName, StreamMessageId... ids);
/**
* Returns common info about pending messages by group name.
*
* @param groupName - name of group
* @return result object
*/
RFuture getPendingInfoAsync(String groupName);
/**
* Returns list of common info about pending messages by group name.
* Limited by minimum idle time, messages count, start and end Stream Message IDs.
*
* {@link StreamMessageId#MAX} is used as max Stream Message ID
* {@link StreamMessageId#MIN} is used as min Stream Message ID
*
* Requires Redis 6.2.0 and higher.
*
* @see #pendingRangeAsync
*
* @param groupName - name of group
* @param startId - start Stream Message ID
* @param idleTime - minimum idle time of messages
* @param idleTimeUnit - idle time unit
* @param endId - end Stream Message ID
* @param count - amount of messages
* @return list
*/
RFuture> listPendingAsync(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count);
/**
* Returns list of common info about pending messages by group and consumer name.
* Limited by minimum idle time, messages count, start and end Stream Message IDs.
*
* {@link StreamMessageId#MAX} is used as max Stream Message ID
* {@link StreamMessageId#MIN} is used as min Stream Message ID
*
* Requires Redis 6.2.0 and higher.
*
* @see #pendingRangeAsync
*
* @param consumerName - name of consumer
* @param groupName - name of group
* @param startId - start Stream Message ID
* @param endId - end Stream Message ID
* @param idleTime - minimum idle time of messages
* @param idleTimeUnit - idle time unit
* @param count - amount of messages
* @return list
*/
RFuture> listPendingAsync(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count);
/**
* Returns list of common info about pending messages by group name.
* Limited by start Stream Message ID and end Stream Message ID and count.
*
* {@link StreamMessageId#MAX} is used as max Stream Message ID
* {@link StreamMessageId#MIN} is used as min Stream Message ID
*
* @see #pendingRangeAsync
*
* @param groupName - name of group
* @param startId - start Stream Message ID
* @param endId - end Stream Message ID
* @param count - amount of messages
* @return list
*/
RFuture> listPendingAsync(String groupName, StreamMessageId startId, StreamMessageId endId, int count);
/**
* Returns list of common info about pending messages by group and consumer name.
* Limited by start Stream Message ID and end Stream Message ID and count.
*
* {@link StreamMessageId#MAX} is used as max Stream Message ID
* {@link StreamMessageId#MIN} is used as min Stream Message ID
*
* @see #pendingRangeAsync
*
* @param consumerName - name of consumer
* @param groupName - name of group
* @param startId - start Stream Message ID
* @param endId - end Stream Message ID
* @param count - amount of messages
* @return list
*/
RFuture> listPendingAsync(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count);
/**
* Returns stream data of pending messages by group name.
* Limited by start Stream Message ID and end Stream Message ID and count.
*
* {@link StreamMessageId#MAX} is used as max Stream Message ID
* {@link StreamMessageId#MIN} is used as min Stream Message ID
*
* @see #listPendingAsync
*
* @param groupName - name of group
* @param startId - start Stream Message ID
* @param endId - end Stream Message ID
* @param count - amount of messages
* @return map
*/
RFuture