Zing::PubSub - Pub/Sub Store
Generic Pub/Sub Store
use Zing::PubSub; my $pubsub = Zing::PubSub->new(name => 'tasks'); # $pubsub->recv;
This package provides a general-purpose publish/subscribe store abstraction.
This package inherits behaviors from:
Zing::Repo
This package uses type constraints from:
Zing::Types
This package implements the following methods:
poll() : Poll
The poll method returns a Zing::Poll object which can be used to perform a blocking-fetch from the store.
# given: synopsis $pubsub->poll;
recv() : Maybe[HashRef]
The recv method receives a single new message from the store.
# given: synopsis $pubsub->recv;
# given: synopsis $pubsub->send({ task => 'restart' }); $pubsub->recv;
send(Str $key, HashRef $value) : Int
The send method sends a new message to the store and return the message count.
# given: synopsis $pubsub->send({ task => 'restart' });
# given: synopsis $pubsub->drop; $pubsub->send({ task => 'stop' }); $pubsub->send({ task => 'restart' });
term(Str @keys) : Str
The term method return a term (safe string) for the store.
# given: synopsis $pubsub->term;
Al Newkirk, awncorp@cpan.org
awncorp@cpan.org
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Zing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zing
CPAN shell
perl -MCPAN -e shell install Zing
For more information on module installation, please visit the detailed CPAN module installation guide.