Skip to content

Commit 7e17458

Browse files
committed
More documentation
1 parent 183a4fc commit 7e17458

File tree

9 files changed

+1566
-497
lines changed

9 files changed

+1566
-497
lines changed

.yardopts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
./ext/concurrent_ruby_ext/**/*.c
1212
-
1313
doc/thread_pools.md
14+
doc/promises.out.md
1415
README.md
1516
LICENSE.txt

doc/promises-main.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Description
2+
3+
Promises is a new framework unifying former `Concurrent::Future`,
4+
`Concurrent::Promise`, `Concurrent::IVar`, `Concurrent::Event`,
5+
`Concurrent.dataflow`, `Delay`, `TimerTask` . It extensively uses the new
6+
synchronization layer to make all the methods *lock-free* (with the exception
7+
of obviously blocking operations like `#wait`, `#value`, etc.). As a result it
8+
lowers a danger of deadlocking and offers better performance.
9+
10+
It provides tools as other promise libraries, users coming from other languages
11+
and other promise libraries will find the same tools here (probably named
12+
differently though). The naming convention borrows heavily from JS promises.
13+
14+
This framework however is not just a re-implementation of other promise
15+
library, it takes inspiration from many other promise libraries, adds new
16+
ideas, and integrates with other abstractions like actors and channels.
17+
Therefore it is much more likely that user fill find a suitable solution for
18+
his problem in this library, or if needed he will be able to combine parts
19+
which were designed to work together well (rather than having to combine
20+
fragilely independent tools).
21+
22+
> *Note:* The channel and actor integration is younger and will stay in edge for
23+
> a little longer than core promises.
24+
25+
> *TODO*
26+
>
27+
> - What is it?
28+
> - What is it for?
29+
> - Main classes {Future}, {Event}
30+
> - Explain pool usage :io vs :fast, and `_on` `_using` suffixes.
31+
> - Why is this better than other solutions, integration actors and channels
32+
33+
# Main classes
34+
35+
The main public user-facing classes are {Concurrent::Promises::Event} and
36+
{Concurrent::Promises::Future} which share common ancestor
37+
{Concurrent::Promises::AbstractEventFuture}.
38+
39+
**Event:**
40+
> {include:Concurrent::Promises::Event}
41+
42+
**Future:**
43+
> {include:Concurrent::Promises::Future}
44+

0 commit comments

Comments
 (0)