| Did you know ... | Search Documentation: |
| Pack canny_tudor -- prolog/redis/xgroup.pl |
Wraps Redis's `XGROUP CREATE` command with xgroup_create/3 and
xgroup_create/4. Translates Prolog options into Redis command arguments,
extracts stream id/1 (default $), handles make_stream(true) and
entries_read/1, and captures optional reply. Behaves idempotently by
catching BUSYGROUP errors.
The predicate can be called with or without the Options argument. If Options is not provided, it defaults to an empty list. The Options argument allows for additional customisation of the command execution, such as specifying the ID for the consumer group, whether to create the stream if it does not exist, and how many entries to read when the group is created.
Example usage:
% Create a consumer group named "mygroup" for the stream "mystream" in % the Redis instance "myredis". ?- xgroup_create(myredis, mystream, mygroup).
Delete a consumer group named "mygroup" for the stream "mystream" in the Redis instance "myredis" using:
?- redis(myredis, xgroup(destroy, mystream, mygroup), _).
The following predicates are exported, but not or incorrectly documented.