Permalink
Browse files

Explicitly export watches() and emits() from their corresponding Refl…

…ex traits.
  • Loading branch information...
1 parent 71a77f8 commit e0d6b992e52a4f93e58bd96f985f82896d563ce4 @rcaputo committed May 31, 2011
View
@@ -75,7 +75,7 @@ __END__
extends 'Reflex::Base';
-use Reflex::Trait::Watched;
+use Reflex::Trait::Watched qw(watches);
use Reflex::PID;
use Carp qw(croak);
@@ -13,7 +13,7 @@
use Moose;
extends 'Reflex::Base';
use Reflex::POE::Wheel::Run;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
watches child => (
isa => 'Maybe[Reflex::POE::Wheel::Run]',
View
@@ -14,7 +14,7 @@
use Moose;
extends 'Reflex::Base';
use Reflex::POE::Session;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
use POE qw(Component::IRC);
@@ -10,7 +10,7 @@
use Moose;
extends 'Reflex::Base';
use Reflex::Interval;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
watches ticker => (
isa => 'Reflex::Interval',
@@ -19,7 +19,7 @@
package Pinger;
use Moose;
extends 'Reflex::Base';
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
watches echoer => (
isa => 'Echoer',
@@ -57,7 +57,7 @@
use Moose;
with 'Reflex::Role::Collectible';
extends 'Reflex::Base'; # TODO - Implicit in Reflex::Role::Collectible?
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
use Reflex::Interval;
has id => (
View
@@ -6,7 +6,7 @@ package Ttl::Bin;
use Moose;
extends 'Reflex::Base';
-use Reflex::Trait::EmitsOnChange;
+use Reflex::Trait::EmitsOnChange qw(emits);
emits a => ( isa => 'Bool', event => 'change' );
emits b => ( isa => 'Bool', event => 'change' );
@@ -10,8 +10,8 @@ use Moose;
extends 'Reflex::Base';
use Ttl::TriNand;
-use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Watched;
+use Reflex::Trait::EmitsOnChange qw(emits);
+use Reflex::Trait::Watched qw(watches);
emits clear => ( isa => 'Bool' );
emits clock => ( isa => 'Bool' );
@@ -18,8 +18,8 @@ extends 'Reflex::Base';
use Ttl::Latch::ClockedNandRS;
use Ttl::Not;
-use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Watched;
+use Reflex::Trait::EmitsOnChange qw(emits);
+use Reflex::Trait::Watched qw(watches);
watches cnrs1 => (
isa => 'Ttl::Latch::ClockedNandRS',
@@ -7,8 +7,8 @@ use Moose;
extends 'Reflex::Base';
use Ttl::FlipFlop::D;
-use Reflex::Trait::Watched;
-use Reflex::Trait::EmitsOnChange;
+use Reflex::Trait::Watched qw(watches);
+use Reflex::Trait::EmitsOnChange qw(emits);
watches dff => (
isa => 'Ttl::FlipFlop::D',
@@ -7,7 +7,7 @@ package Ttl::HexDecoder;
use Moose;
extends 'Reflex::Base';
-use Reflex::Trait::EmitsOnChange;
+use Reflex::Trait::EmitsOnChange qw(emits);
emits ones => ( isa => 'Bool', event => 'change' );
emits twos => ( isa => 'Bool', event => 'change' );
@@ -18,8 +18,8 @@ extends 'Reflex::Base';
use Ttl::Nand;
use Ttl::Latch::NandRS;
-use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Watched;
+use Reflex::Trait::EmitsOnChange qw(emits);
+use Reflex::Trait::Watched qw(watches);
watches nand_not_r => ( isa => 'Ttl::Nand', handles => { not_r => 'b' } );
watches nand_s => ( isa => 'Ttl::Nand', handles => { s => 'a' } );
@@ -19,8 +19,8 @@ use Moose;
extends 'Reflex::Base';
use Ttl::Nand;
-use Reflex::Trait::Watched;
-use Reflex::Trait::EmitsOnChange;
+use Reflex::Trait::Watched qw(watches);
+use Reflex::Trait::EmitsOnChange qw(emits);
watches nand_r => ( isa => 'Ttl::Nand', handles => { r => 'b' } );
watches nand_s => ( isa => 'Ttl::Nand', handles => { s => 'a' } );
@@ -19,8 +19,8 @@ use Moose;
extends 'Reflex::Base';
use Ttl::Nor;
-use Reflex::Trait::Watched;
-use Reflex::Trait::EmitsOnChange;
+use Reflex::Trait::Watched qw(watches);
+use Reflex::Trait::EmitsOnChange qw(emits);
watches nor_r => ( isa => 'Ttl::Nor', handles => { r => 'a' } );
watches nor_s => ( isa => 'Ttl::Nor', handles => { s => 'b' } );
View
@@ -13,7 +13,7 @@ extends 'Ttl::Bin';
use Ttl::Not;
use Ttl::And;
-use Reflex::Trait::Watched;
+use Reflex::Trait::Watched qw(watches);
watches and => (
isa => 'Ttl::And',
@@ -21,8 +21,8 @@ use Moose;
extends 'Reflex::Base';
use Ttl::And;
-use Reflex::Trait::Watched;
-use Reflex::Trait::EmitsOnChange;
+use Reflex::Trait::Watched qw(watches);
+use Reflex::Trait::EmitsOnChange qw(emits);
watches and_ab => ( isa => 'Ttl::And', handles => [qw(a b)] );
watches and_c => ( isa => 'Ttl::And', handles => { c => 'b' } );
@@ -21,8 +21,8 @@ extends 'Reflex::Base';
use Ttl::TriAnd;
use Ttl::Not;
-use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Watched;
+use Reflex::Trait::EmitsOnChange qw(emits);
+use Reflex::Trait::Watched qw(watches);
watches tri_and => ( isa => 'Ttl::TriAnd', handles => [qw(a b c)] );
watches not => ( isa => 'Ttl::Not' );
View
@@ -5,7 +5,7 @@
package Ttl::Un;
use Moose;
extends 'Reflex::Base';
-use Reflex::Trait::EmitsOnChange;
+use Reflex::Trait::EmitsOnChange qw(emits);
emits in => ( isa => 'Bool', event => 'change' );
emits out => ( isa => 'Bool' );
@@ -9,8 +9,8 @@
package Counter;
use Moose;
extends 'Reflex::Base';
- use Reflex::Trait::EmitsOnChange;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::EmitsOnChange qw(emits);
+ use Reflex::Trait::Watched qw(watches);
use Ttl::FlipFlop::T;
use Ttl::HexDecoder;
@@ -83,7 +83,7 @@
use Moose;
extends 'Reflex::Base';
use Reflex::Interval;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
watches counter => ( isa => 'Counter' );
watches clock => ( isa => 'Reflex::Interval' );
@@ -10,7 +10,7 @@
use Moose;
extends 'Reflex::Base';
use Ttl::And;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
watches ander => ( isa => 'Ttl::And' );
@@ -24,7 +24,7 @@ __END__
=head1 NAME
-Reflex::Acceptor - non-blocking client socket acceptor
+Reflex::Acceptor - a non-blocking server (client socket acceptor)
=head1 SYNOPSIS
@@ -33,12 +33,9 @@ Reflex::Acceptor - non-blocking client socket acceptor
use Moose;
extends 'Reflex::Acceptor';
use Reflex::Collection;
- use EchoStream; # See eg directory.
+ use EchoStream;
- # From Reflex::Collection.
- has_many clients => (
- handles => { remember_client => "remember" },
- );
+ has_many clients => ( handles => { remember_client => "remember" } );
sub on_accept {
my ($self, $args) = @_;
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
# Reflex supports "role-based" callbacks where events are mapped to
# handlers through a handler naming convention. The cb_role()
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
use warnings;
use strict;
@@ -14,8 +14,8 @@ use Test::More tests => 4;
use Moose;
extends 'Reflex::Base';
use Reflex::Interval;
- use Reflex::Trait::EmitsOnChange;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::EmitsOnChange qw(emits);
+ use Reflex::Trait::Watched qw(watches);
use Test::More;
@@ -45,7 +45,7 @@ use Test::More tests => 4;
package Watcher;
use Moose;
extends 'Reflex::Base';
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
use Test::More;
View
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
use warnings;
use strict;
@@ -14,8 +14,8 @@ use Test::More tests => 5;
use Moose;
extends 'Reflex::Base';
use Reflex::Interval;
- use Reflex::Trait::EmitsOnChange;
- use Reflex::Trait::Watched;
+ use Reflex::Trait::EmitsOnChange qw(emits);
+ use Reflex::Trait::Watched qw(watches);
emits count => (
isa => 'Int',
@@ -39,7 +39,7 @@ use Test::More tests => 5;
package Watcher;
use Moose;
extends 'Reflex::Base';
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
use Test::More;
View
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
# This example illustrates implicit and explicit callbacks via plain
# coderefs. Coderef callbacks are clear and concise. They allow
View
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
# This example illustrates explicit callbacks via object methods. A
# ThingWithCallbacks will call methods on objects defined in this
View
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
# This example illustrates explicit callbacks via objects, where
# callback events are mapped to handlers by name. Methods may be
View
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
# This example illustrates explicit callbacks via classes, where
# callback events are mapped to class methods by name. Methods may be
View
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
# This example illustrates explicit callbacks via Reflex roles. An
# object is assigned a role to play in its owner. Event names are
View
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
# This example illustrates explicit a promise-like form of callback.
# The promise acts as an event pipeline. Events emitted from the
@@ -27,7 +27,7 @@ use Test::More tests => 3;
extends 'Reflex::Base';
use Reflex::Interval;
use Reflex::Callbacks qw(gather_cb);
- use Reflex::Trait::Watched;
+ use Reflex::Trait::Watched qw(watches);
watches ticker => (
isa => 'Reflex::Interval',
@@ -1,4 +1,4 @@
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
use warnings;
use strict;
use Test::More;
@@ -1,4 +1,4 @@
-# vim: ts=2 sw=2 expandtab
+# vim: ts=2 sw=2 noexpandtab
{
package Runner;
use Moose;

0 comments on commit e0d6b99

Please sign in to comment.