https://github.com/tynovsky/fork-promise
https://github.com/tynovsky/fork-promise
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/tynovsky/fork-promise
- Owner: tynovsky
- License: other
- Created: 2016-09-21T09:34:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-21T10:43:54.000Z (almost 10 years ago)
- Last Synced: 2025-02-16T03:45:03.808Z (over 1 year ago)
- Language: Perl
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/tynovsky/Fork-Promise)
# NAME
Fork::Promise - run a code in a subprocess and get a promise that it ended
# SYNOPSIS
use Fork::Promise;
use AnyEvent;
my $pp = Fork::Promise->new();
my $condvar = AnyEvent->condvar;
my $promise = $pp->run(sub { sleep 1 });
# DESCRIPTION
Fork::Promise implements only one method - run. It runs given code in a
subprocess and registers AnyEvent child watcher which resolves promise returned
by run method.
# LICENSE
Copyright (C) Avast Software.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
# AUTHOR
Miroslav Tynovsky