NAME
IO::AsyncX::Notifier - easier IO::Async::Notifiers with Object::Pad
SYNOPSIS
use
Object::Pad;
class Example {
inherit IO::AsyncX::Notifier;
# This will be populated by ->configure(example_field => ...)
# or ->new(example_field => ...)
field
$example_field
;
# This will be updated by ->configure (or ->new) in a similar fashion
field
$observable_field
{ Ryu::Observable->new };
# You can have as many other fields as you want, main limitation
# at the moment is that they have to be scalars.
method current_values () {
'Example field: '
.
$example_field
,
' and observable set to '
.
$observable_field
->as_string
}
}
my
$obj
= Example->new(
example_field
=>
'xyz'
,
observable_field
=>
'starting value'
);
join
"\n"
,
$obj
->current_values;
DESCRIPTION
Provides some helper logic to simplify Object::Pad-based IO::Async::Notifier subclasses.
INHERITED METHODS
- IO::Async::Notifier
-
add_child, adopt_future, adopted_futures, can_event, children, configure_unknown, debug_printf, get_loop, invoke_error, invoke_event, loop, make_event_cb, maybe_invoke_event, maybe_make_event_cb, notifier_name, parent, remove_child, remove_from_parent
- Object::Pad::UNIVERSAL
AUTHOR
Tom Molesworth <TEAM@cpan.org>
LICENSE
Copyright Tom Molesworth 2021-2024. Licensed under the same terms as Perl itself.