stream handling functionality, including claiming/pending
get/set and observables
sorted sets
hyperloglog existence
simple queues via lists
pub/sub
This module is responsible for namespacing, connection handling and clustering. It should also cover retry for stateless calls.
Time to wait for items, in milliseconds.
Number of items to allow per batch (pending / readgroup calls).
Check the last id that has been processed by all the consumer groups in the given stream.
Given two IDs, compare them as if doing a <=> numeric comparison.
<=>
Given a stream ID, returns the next ID after it. This is managed by the simple expedient of incrementing the right-hand part of the identifier.
Deal with incoming requests via a stream.
Returns a Ryu::Source which emits Myriad::Redis::Pending items.
Clear up old entries from a stream when it grows too large.
Check for any pending items, claiming them for reprocessing as required.
Takes the following named parameters:
stream - the stream name
stream
group - which consumer group to check
group
client - the name of the client to check
client
Returns the pending items in this stream.
Creates a Redis stream. Note that there is no straight way to do that in Redis without creating a group or adding an event. To overcome this it will create a group with MKSTREAM option Then destroy that init consumer group.
stream - name of the stream we want to create.
Create a Redis consumer group if it does NOT exist.
It'll also send the MKSTREAM option to create the stream if it doesn't exist.
stream - The name of the stream we want to attach the group to.
group - The group name.
start_from - The id of the message that is going to be considered the start of the stream for this group's point of view by default it's $ which means the last message.
start_from
$
Delete a Redis consumer group.
stream - The name of the stream group belongs to.
group - The consumer group name.
Return information about the pending messages for a stream and a consumer group.
This currently just execute XPENDING without any filtering.
XPENDING
stream - The name of the stream we want to check.
group - The consumers group name that we want to check.
Return the length of a given stream
Returns a Redis connection either from a pool of connection or a new one. With the possibility of waiting to get one, if all connection were busy and we maxed out our limit.
This puts back a redis connection into Redis pool, so it can be used by other called. It should be called at the end of every usage, as on_ready.
It should also be possible with a try/finally combination.. but that's currently failing with the $redis_pool slot not being defined.
Takes the following parameters:
$instance - Redis connection to be returned.
$instance
Resolves to a new Net::Async::Redis or Net::Async::Redis::Cluster instance, depending on the setting of $use_cluster.
$use_cluster
Acknowledge a message from a Redis stream.
stream - The stream name.
message_id - The id of the message we want to acknowledge.
message_id
Publish a message through a Redis channel (pub/sub system)
channel - The channel name.
channel
message - The message we want to publish (string).
message
Subscribe to a redis channel.
add_child, adopt_future, adopted_futures, can_event, children, configure_unknown, debug_printf, get_loop, invoke_error, invoke_event, loop, make_event_cb, maybe_invoke_event, maybe_make_event_cb, notifier_name, parent, remove_child, remove_from_parent
BUILDARGS
Deriv Group Services Ltd. DERIV@cpan.org
DERIV@cpan.org
Copyright Deriv Group Services Ltd 2020-2022. Licensed under the same terms as Perl itself.
To install Myriad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Myriad
CPAN shell
perl -MCPAN -e shell install Myriad
For more information on module installation, please visit the detailed CPAN module installation guide.