Ryu::Observable - plus ça change
This module is still of no great use to you in its current state.
Public API, such as it is.
Returns the string representation of this value.
Returns the numeric representation of this value.
Instantiates with the given value.
my $observed = Ryu::Observable->new('whatever');
Requests notifications when the value changes.
my $observed = Ryu::Observable->new('whatever') ->subscribe(sub { print "New value - $_\n" });
Removes an existing callback.
my $code; my $observed = Ryu::Observable->new('whatever') ->subscribe($code = sub { print "New value - $_\n" }) ->set_string('test') ->unsubscribe($code);
Sets the value to the given scalar, then notifies all subscribers (regardless of whether the value has changed or not).
Returns the raw value.
Applies a new numeric value, and notifies subscribers if the value is numerically different to the previous one (or if we had no previous value).
Returns $self.
$self
Applies a new string value, and notifies subscribers if the value stringifies to a different value than the previous one (or if we had no previous value).
Returns a Ryu::Source, which will emit each new value until the observable is destroyed.
Don't use these.
Notifies all currently-subscribed callbacks with the current value.
Tom Molesworth <TEAM@cpan.org>
Copyright Tom Molesworth 2011-2016. Licensed under the same terms as Perl itself.
To install Ryu, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ryu
CPAN shell
perl -MCPAN -e shell install Ryu
For more information on module installation, please visit the detailed CPAN module installation guide.