Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathanstowe/manifesto
Make a supply of the results of Promises
https://github.com/jonathanstowe/manifesto
promise raku reactive
Last synced: 18 days ago
JSON representation
Make a supply of the results of Promises
- Host: GitHub
- URL: https://github.com/jonathanstowe/manifesto
- Owner: jonathanstowe
- License: artistic-2.0
- Created: 2016-11-23T21:24:09.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-28T17:23:14.000Z (7 months ago)
- Last Synced: 2024-04-28T18:28:02.487Z (7 months ago)
- Topics: promise, raku, reactive
- Language: Raku
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# Manifesto
Make a supply of the results of Promises
[![CI](https://github.com/jonathanstowe/Manifesto/actions/workflows/main.yml/badge.svg)](https://github.com/jonathanstowe/Manifesto/actions/workflows/main.yml)
## Synopsis
A different version of the old 'sleep sort'
```raku
use Manifesto;my $manifesto = Manifesto.new;
for (^10).pick(*).map( -> $i { Promise.in($i + 0.5).then({ $i })}) -> $p {
$manifesto.add-promise($p);
}my $channel = Channel.new;
react {
whenever $manifesto -> $v {
$channel.send: $v;
}
whenever $manifesto.empty {
$channel.close;
done;
}
}say $channel.list;
```
## Description
This manages a collection of Promise objects and provides a Supply
of the result of the kept Promises.This is useful to aggregate a number of Promises to a single stream
of results, which may then be used in, a _react_ or _supply_ block
or otherwise tapped.## Installation
Assuming you have a working installation of Rakudo installed with *zef* you should be able to do either:
zef install Manifesto
# or from a local checkout
zef install .
Other equally capable installers may become available in the future.
## Support
This is so simple I'm not sure there is much scope for many bugs, but
if you have any questions, suggestions, patches or whatever please send
them via [GitHub](https://github.com/jonathanstowe/Manifesto/issues)## Copyright and Licence
© Jonathan Stowe 2016 - 2021
This is free software, the terms are described in the [LICENCE](LICENCE) file in this repository.