Permalink
Browse files

Rename "observe" to "watch".

It's shorter, and it aligns the names of things with what node.js
people understand.
  • Loading branch information...
1 parent 20c1bb9 commit 9513af3bd7026db10548a3071870be7a2e21749f @rcaputo committed May 26, 2011
View
@@ -77,7 +77,7 @@ __END__
extends 'Reflex::Base';
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
use Reflex::PID;
use Carp qw(croak);
@@ -87,7 +87,7 @@ use Symbol qw(gensym);
__END__
-observes process => ( isa => 'Maybe[Reflex::PID]', is => 'rw' );
+watches process => ( isa => 'Maybe[Reflex::PID]', is => 'rw' );
has [qw(stdin stdout stderr)] => (
isa => 'Maybe[FileHandle]',
View
@@ -13,14 +13,14 @@
use Moose;
extends 'Reflex::Base';
use Reflex::UdpPeer;
- use Reflex::Trait::Observed qw(observes);
+ use Reflex::Trait::Watched qw(watches);
has port => (
isa => 'Int',
is => 'ro',
);
- observes peer => (
+ watches peer => (
isa => 'Maybe[Reflex::UdpPeer]',
setup => sub {
my $self = shift;
@@ -12,9 +12,9 @@
use Moose;
extends 'Reflex::Base';
use Reflex::POE::Wheel::Run;
- use Reflex::Trait::Observed;
+ use Reflex::Trait::Watched;
- observes child => (
+ watches child => (
isa => 'Maybe[Reflex::POE::Wheel::Run]',
);
View
@@ -13,7 +13,7 @@
use Moose;
extends 'Reflex::Base';
use Reflex::POE::Session;
- use Reflex::Trait::Observed;
+ use Reflex::Trait::Watched;
use POE qw(Component::IRC);
@@ -22,7 +22,7 @@
is => 'rw',
);
- observes poco_watcher => (
+ watches poco_watcher => (
isa => 'Reflex::POE::Session',
role => 'poco',
);
View
@@ -9,9 +9,9 @@
use Moose;
extends 'Reflex::Base';
use Reflex::Interval;
- use Reflex::Trait::Observed;
+ use Reflex::Trait::Watched;
- observes ticker => (
+ watches ticker => (
isa => 'Reflex::Interval',
setup => { interval => 1, auto_repeat => 1 },
);
View
@@ -18,9 +18,9 @@
package Pinger;
use Moose;
extends 'Reflex::Base';
- use Reflex::Trait::Observed;
+ use Reflex::Trait::Watched;
- observes echoer => (
+ watches echoer => (
isa => 'Echoer',
default => sub { Echoer->new() },
);
@@ -56,7 +56,7 @@
use Moose;
with 'Reflex::Role::Collectible';
extends 'Reflex::Base'; # TODO - Implicit in Reflex::Role::Collectible?
- use Reflex::Trait::Observed;
+ use Reflex::Trait::Watched;
use Reflex::Interval;
has id => (
@@ -70,7 +70,7 @@
default => 0,
);
- observes timer => (
+ watches timer => (
is => 'rw',
isa => 'Maybe[Reflex::Interval]',
setup => sub {
View
@@ -32,16 +32,16 @@ use Ttl::Xor;
use Ttl::And;
use Ttl::Or;
-emits a => ( isa => 'Bool' );
-emits b => ( isa => 'Bool' );
-emits cin => ( isa => 'Bool' );
-observes xor_ab => ( isa => 'Ttl::Xor' );
-observes xor_cin => ( isa => 'Ttl::Xor' );
-observes and_ab => ( isa => 'Ttl::And' );
-observes and_cin => ( isa => 'Ttl::And' );
-observes or_cout => ( isa => 'Ttl::Or' );
-emits sum => ( isa => 'Bool' );
-emits cout => ( isa => 'Bool' );
+emits a => ( isa => 'Bool' );
+emits b => ( isa => 'Bool' );
+emits cin => ( isa => 'Bool' );
+watches xor_ab => ( isa => 'Ttl::Xor' );
+watches xor_cin => ( isa => 'Ttl::Xor' );
+watches and_ab => ( isa => 'Ttl::And' );
+watches and_cin => ( isa => 'Ttl::And' );
+watches or_cout => ( isa => 'Ttl::Or' );
+emits sum => ( isa => 'Bool' );
+emits cout => ( isa => 'Bool' );
sub on_my_a {
my ($self, $args) = @_;
View
@@ -11,7 +11,7 @@ extends 'Reflex::Base';
use Ttl::TriNand;
use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
emits clear => ( isa => 'Bool' );
emits clock => ( isa => 'Bool' );
@@ -100,11 +100,11 @@ sub on_tri6_out {
$self->tri5->c($args->{value});
}
-observes tri1 => ( isa => 'Ttl::TriNand' );
-observes tri2 => ( isa => 'Ttl::TriNand' );
-observes tri3 => ( isa => 'Ttl::TriNand' );
-observes tri4 => ( isa => 'Ttl::TriNand' );
-observes tri5 => ( isa => 'Ttl::TriNand' );
-observes tri6 => ( isa => 'Ttl::TriNand' );
+watches tri1 => ( isa => 'Ttl::TriNand' );
+watches tri2 => ( isa => 'Ttl::TriNand' );
+watches tri3 => ( isa => 'Ttl::TriNand' );
+watches tri4 => ( isa => 'Ttl::TriNand' );
+watches tri5 => ( isa => 'Ttl::TriNand' );
+watches tri6 => ( isa => 'Ttl::TriNand' );
1;
@@ -23,22 +23,22 @@ use Moose;
extends 'Reflex::Base';
use Ttl::Latch::ClockedNandRS;
-observes nand_j => (
+watches nand_j => (
isa => 'Ttl::Nand',
handles => { j => 'a' },
);
-observes nand_k => (
+watches nand_k => (
isa => 'Ttl::Nand',
handles => { k => 'b' },
);
-observes trinand_preset => (
+watches trinand_preset => (
isa => 'Ttl::TriNand',
handles => { preset => 'a' },
);
-observes trinand_clear => (
+watches trinand_clear => (
isa => 'Ttl::TriNand',
handles => { clear => 'c' },
);
@@ -19,15 +19,15 @@ use Ttl::Latch::ClockedNandRS;
use Ttl::Not;
use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
-observes cnrs1 => (
+watches cnrs1 => (
isa => 'Ttl::Latch::ClockedNandRS',
handles => ['r', 's'],
);
-observes cnrs2 => ( isa => 'Ttl::Latch::ClockedNandRS' );
-observes not => ( isa => 'Ttl::Not' );
+watches cnrs2 => ( isa => 'Ttl::Latch::ClockedNandRS' );
+watches not => ( isa => 'Ttl::Not' );
sub BUILD {
my $self = shift;
View
@@ -7,10 +7,10 @@ use Moose;
extends 'Reflex::Base';
use Ttl::FlipFlop::D;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
use Reflex::Trait::EmitsOnChange;
-observes dff => (
+watches dff => (
isa => 'Ttl::FlipFlop::D',
handles => ['preset','clear','clock'],
);
@@ -19,10 +19,10 @@ use Ttl::Nand;
use Ttl::Latch::NandRS;
use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
-observes nand_not_r => ( isa => 'Ttl::Nand', handles => { not_r => 'b' } );
-observes nand_s => ( isa => 'Ttl::Nand', handles => { s => 'a' } );
+watches nand_not_r => ( isa => 'Ttl::Nand', handles => { not_r => 'b' } );
+watches nand_s => ( isa => 'Ttl::Nand', handles => { s => 'a' } );
emits clk => ( isa => 'Bool' );
sub on_my_clk {
@@ -31,7 +31,7 @@ sub on_my_clk {
$self->nand_not_r()->a($args->{value});
}
-observes latch => ( isa => 'Ttl::Latch::NandRS' );
+watches latch => ( isa => 'Ttl::Latch::NandRS' );
sub BUILD {
my $self = shift;
View
@@ -19,13 +19,13 @@ use Moose;
extends 'Reflex::Base';
use Ttl::Nand;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
use Reflex::Trait::EmitsOnChange;
-observes nand_r => ( isa => 'Ttl::Nand', handles => { r => 'b' } );
-observes nand_s => ( isa => 'Ttl::Nand', handles => { s => 'a' } );
-emits q => ( isa => 'Bool' );
-emits not_q => ( isa => 'Bool' );
+watches nand_r => ( isa => 'Ttl::Nand', handles => { r => 'b' } );
+watches nand_s => ( isa => 'Ttl::Nand', handles => { s => 'a' } );
+emits q => ( isa => 'Bool' );
+emits not_q => ( isa => 'Bool' );
sub on_nand_s_out {
my ($self, $args) = @_;
View
@@ -19,13 +19,13 @@ use Moose;
extends 'Reflex::Base';
use Ttl::Nor;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
use Reflex::Trait::EmitsOnChange;
-observes nor_r => ( isa => 'Ttl::Nor', handles => { r => 'a' } );
-observes nor_s => ( isa => 'Ttl::Nor', handles => { s => 'b' } );
-emits q => ( isa => 'Bool' );
-emits not_q => ( isa => 'Bool' );
+watches nor_r => ( isa => 'Ttl::Nor', handles => { r => 'a' } );
+watches nor_s => ( isa => 'Ttl::Nor', handles => { s => 'b' } );
+emits q => ( isa => 'Bool' );
+emits not_q => ( isa => 'Bool' );
sub on_nor_s_out {
my ($self, $args) = @_;
View
@@ -13,15 +13,15 @@ extends 'Ttl::Bin';
use Ttl::Not;
use Ttl::And;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
-observes and => (
+watches and => (
isa => 'Ttl::And',
handles => [qw(a b)],
setup => sub { Ttl::And->new() },
);
-observes not => (
+watches not => (
isa => 'Ttl::Not',
setup => sub { Ttl::Not->new() },
);
View
@@ -13,11 +13,11 @@ extends 'Ttl::Bin';
use Ttl::Not;
use Ttl::Or;
-use Reflex::Role::Observed;
+use Reflex::Role::Watched;
# Ttl::Or handles a and b input for Ttl::Nor.
-observes or => ( isa => 'Ttl::Or', handles => [qw(a b)] );
-observes not => ( isa => 'Ttl::Not' );
+watches or => ( isa => 'Ttl::Or', handles => [qw(a b)] );
+watches not => ( isa => 'Ttl::Not' );
sub BUILD {
my $self = shift;
View
@@ -21,12 +21,12 @@ use Moose;
extends 'Reflex::Base';
use Ttl::And;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
use Reflex::Trait::EmitsOnChange;
-observes and_ab => ( isa => 'Ttl::And', handles => [qw(a b)] );
-observes and_c => ( isa => 'Ttl::And', handles => { c => 'b' } );
-emits out => ( isa => 'Bool' );
+watches and_ab => ( isa => 'Ttl::And', handles => [qw(a b)] );
+watches and_c => ( isa => 'Ttl::And', handles => { c => 'b' } );
+emits out => ( isa => 'Bool' );
sub BUILD {
my $self = shift;
View
@@ -22,11 +22,11 @@ use Ttl::TriAnd;
use Ttl::Not;
use Reflex::Trait::EmitsOnChange;
-use Reflex::Trait::Observed;
+use Reflex::Trait::Watched;
-observes tri_and => ( isa => 'Ttl::TriAnd', handles => [qw(a b c)] );
-observes not => ( isa => 'Ttl::Not' );
-emits out => ( isa => 'Bool' );
+watches tri_and => ( isa => 'Ttl::TriAnd', handles => [qw(a b c)] );
+watches not => ( isa => 'Ttl::Not' );
+emits out => ( isa => 'Bool' );
sub BUILD {
my $self = shift;
View
@@ -9,7 +9,7 @@
use Moose;
extends 'Reflex::Base';
use Reflex::Trait::EmitsOnChange;
- use Reflex::Trait::Observed;
+ use Reflex::Trait::Watched;
use Ttl::FlipFlop::T;
use Ttl::HexDecoder;
@@ -18,12 +18,12 @@
# The counter schematic comes from Don Lancaster's _TTL Cookbook_.
# Other sources (like www.play-hookey.com) seem to be flaky.
- observes t1 => ( isa => 'Ttl::FlipFlop::T', handles => ['clock'] );
- observes t2 => ( isa => 'Ttl::FlipFlop::T' );
- observes t4 => ( isa => 'Ttl::FlipFlop::T' );
- observes t8 => ( isa => 'Ttl::FlipFlop::T' );
- observes decoder => ( isa => 'Ttl::HexDecoder' );
- emits out => ( isa => 'Str' );
+ watches t1 => ( isa => 'Ttl::FlipFlop::T', handles => ['clock'] );
+ watches t2 => ( isa => 'Ttl::FlipFlop::T' );
+ watches t4 => ( isa => 'Ttl::FlipFlop::T' );
+ watches t8 => ( isa => 'Ttl::FlipFlop::T' );
+ watches decoder => ( isa => 'Ttl::HexDecoder' );
+ emits out => ( isa => 'Str' );
sub on_t1_q {
my ($self, $args) = @_;
@@ -82,10 +82,10 @@
use Moose;
extends 'Reflex::Base';
use Reflex::Interval;
- use Reflex::Trait::Observed;
+ use Reflex::Trait::Watched;
- observes counter => ( isa => 'Counter' );
- observes clock => ( isa => 'Reflex::Interval' );
+ watches counter => ( isa => 'Counter' );
+ watches clock => ( isa => 'Reflex::Interval' );
sub BUILD {
my $self = shift;
Oops, something went wrong.

0 comments on commit 9513af3

Please sign in to comment.