-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathfaq.html
More file actions
62 lines (55 loc) · 2.89 KB
/
faq.html
File metadata and controls
62 lines (55 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
title: FAQ - Frequently Asked Questions
permalink: /faq
layout: base
---
<div class="content site-width">
<h1>FAQ - Frequently Asked Questions</h1>
<h3>What is Amp?</h3>
<p>
Amp is a concurrency framework for PHP providing primitives to manage concurrency such as an event loop,
promises, and asynchronous iterators.
</p>
<h3>What is amphp?</h3>
<p>
Amphp is the group behind Amp maintaining it and its core components.
</p>
<h3>When should I use Amp?</h3>
<p>
Amp is always useful if you have I/O-bound tasks that can run concurrently, e.g. making two HTTP requests
concurrently instead of sequentially and operating on the result of both. Such I/O-bound tasks include <a
href="https://github.com/amphp/aerys">WebSocket servers</a> and <a href="https://github.com/Room-11/Jeeves">chat
bots</a>.
</p>
<h3>Why should I use Amp over other solutions like ReactPHP?</h3>
<p>
Amp makes async code more readable with coroutines instead of <code>then</code>-chains and generally has more focus on performance. <a href="//amphp.org/react-adapter/">But why not both?</a> Amp is fully compatible with any ReactPHP library.
</p>
<h3>Why did you develop Amp instead of contributing to ReactPHP?</h3>
<p>
It might surprise you, but Amp isn't that much younger than ReactPHP. At the time Amp was started, ReactPHP was
still very young. ReactPHP was inspired a lot by Node and thus offers a lot of callback based APIs. Amp follows
a different approach and uses PHP's generators to build coroutines which make async code way easier to reason
about. We think <code>then()</code>-style promises are sub-optimal in a world with generators.
</p>
<h3>What is the status of Amp?</h3>
<p>
Amp is very stable. Its first stable version dates back to 2015 with v1.0.0. v2.0.0 is a result of the discussions
in the <a href="https://github.com/async-interop/event-loop"><code>async-interop</code></a> group and the merge
with <a href="https://github.com/icicleio/icicle">Icicle</a>, providing even better APIs for writing concurrent
and even <a href="https://github.com/amphp/parallel">parallel</a> code now.
</p>
<p>
Other components might not be as stable as Amp itself. If you want to know more about the stability of a specific
component, just have a look at its documentation.
</p>
<h3>How can I contribute?</h3>
<p>
Everyone can help. To get started, there are open <a
href="https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+user%3Aamphp">discussions on
GitHub</a> you can contribute to.
Found something you could work on? Comment and open a pull request. Missing a specific package that isn't async
compatible? Write it.
Have feedback? Great!
</p>
</div>