NAME

Thread::Csp::Promise - Promises for thread return values.

VERSION

version 0.008

SYNOPSIS

 my $promise = Thread::Csp->spawn('Module', 'Module::function', $input, $output);
 $promise->get;

DESCRIPTION

This represents the return value of a thread, as return by spawn. This class is highly experimental and may disappear in the future.

METHODS

get()

This waits for the thread to finish, and will either return its value, or throw the exception that it died with. It may be called any number of times.

is_finished()

This returns true if the promise is finished.

finished_fh()

This returns a handle that one byte will be written to when the promise finishes (or immediately if the promise is already finished).

AUTHOR

Leon Timmermans <leont@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.