1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use AsyncTypedCommands;
use RedisResult;
/// Creates a consumer group for a Redis stream, ensuring idempotent behavior.
///
/// If the group already exists, the function returns `Ok(())` instead of failing.
/// This is achieved by ignoring "BUSYGROUP" errors, which are returned when attempting
/// to create a group that already exists.
///
/// # Arguments
///
/// * `con` - An async-capable Redis command connection
/// * `stream_name` - The name of the Redis stream
/// * `group_name` - The name of the consumer group to create
///
/// # Returns
///
/// * `Ok(())` - If the group was created or already exists
/// * `Err(RedisError)` - If the operation fails for any reason other than group already existing
pub async