Zing::Mailbox - Process Mailbox
Interprocess Communication Mechanism
use Zing::Mailbox; my $mailbox = Zing::Mailbox->new(name => rand); # $mailbox->recv;
This package provides represents a process mailbox, the default mechanism of interprocess communication.
This package inherits behaviors from:
Zing::PubSub
This package uses type constraints from:
Zing::Types
This package has the following attributes:
name(Str)
This attribute is read-only, accepts (Str) values, and is optional.
(Str)
This package implements the following methods:
recv() : Maybe[HashRef]
The recv method receives a single new message from the mailbox.
# given: synopsis $mailbox->recv;
# given: synopsis $mailbox->send($mailbox->term, { status => 'hello' }); $mailbox->recv;
reply(HashRef $message, HashRef $value) : Int
The reply method sends a message to the mailbox represented by the $bag received and returns the size of the recipient mailbox.
$bag
# given: synopsis $mailbox->send($mailbox->term, { status => 'hello' }); my $message = $mailbox->recv; $mailbox->reply($message, { status => 'thank you' });
send(Str $key, HashRef $value) : Int
The send method sends a new message to the mailbox specified and returns the size of the recipient mailbox.
# given: synopsis $mailbox->send($mailbox->term, { status => 'hello' });
size() : Int
The size method returns the message count of the mailbox.
# given: synopsis my $size = $mailbox->size;
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.