The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

AnyEvent::Blackboard - An extension of Async::Blackboard which uses AnyEvent for timeouts.

SYNOPSIS

  my $blackboard = AnyEvent::Blackboard->new();

  $blackboard->watch([qw( foo bar )], [ $object, "found_foobar" ]);
  $blackboard->watch(foo => [ $object, "found_foo" ]);

  # After 250ms, provide ``undef'' for ``foo''
  $blackboard->timeout(foo => 0.25);

RATIONALE

Async::Blackboard makes a fantastic synchronization component -- however, it does have the possible condition of allowing control to be abandoned due to a lack value. This subclass adds the functionality of timeouts on keys to ensure this doesn't happen.

ATTRIBUTES

default_timeout -> Num

Default timeout in (optionally fractional) seconds.

METHODS

timeout SECONDS, [ KEY, [, DEFAULT ] ]

Set a timer for N seconds to provide "default" value as a value, defaults to `undef`. This can be used to ensure that blackboard workflows do not reach a dead-end if a required value is difficult to obtain.

watch KEYS, WATCHER [, KEYS, WATCHER ]
watch KEY, WATCHER [, KEYS, WATCHER ]

Overrides Async::Blackboard only for the purpose of adding a timeout.

clone

Create a clone of this blackboard. This will not dispatch any events, even if the blackboard is prepopulated.

BUGS

None known.

LICENSE

Copyright © 2011, Say Media. Distributed under the Artistic License, 2.0.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 61:

=back without =over

Around line 158:

Non-ASCII character seen before =encoding in '©'. Assuming UTF-8