| POEx-PubSub documentation | Contained in the POEx-PubSub distribution. |
POEx::PubSub::Types - Exported Types for use within POEx::PubSub
version 1.102740
This modules exports the needed subtypes, coercions, and constants for PubSub and is based on Sub::Exporter, so see that module for options on importing.
The publish type constraint applied to Events. Can either be PUBLISH_INPUT or PUBLISH_OUTPUT
When manipulating subscribers in an Event, expect to receive a well formed hash with the keys 'session' and 'event' corresponding to the subscribers SessionID and their event handler, respectively
This indicates the Event is an output event
This indicates the Event is an input event
Nicholas Perez <nperez@cpan.org>
This software is copyright (c) 2010 by Nicholas Perez.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| POEx-PubSub documentation | Contained in the POEx-PubSub distribution. |
package POEx::PubSub::Types; BEGIN { $POEx::PubSub::Types::VERSION = '1.102740'; } #ABSTRACT: Exported Types for use within POEx::PubSub use Moose; use MooseX::Types -declare => [ 'PublishType', 'Subscriber' ]; use MooseX::Types::Moose('Int', 'Str'); use MooseX::Types::Structured('Dict'); use POEx::Types(':all'); use constant PUBLISH_OUTPUT => 2; use constant PUBLISH_INPUT => -2; use Sub::Exporter -setup => { exports => [ qw/ PublishType Subscriber PUBLISH_INPUT PUBLISH_OUTPUT / ] }; subtype PublishType, as Int, where { $_ == -2 || $_ == 2 }, message { 'PublishType is not PublishInput or PublishOutput' }; subtype Subscriber, as Dict[session => SessionID, event => Str]; 1;
__END__