1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00
Commit Graph

246 Commits

Author SHA1 Message Date
Daniel Lowrey
834255163c Refactor coroutine functionality 2015-03-16 15:00:17 -04:00
Daniel Lowrey
87ca482e14 Merge pull request #24 from PeeHaa/guide-fixes
Guide fixes
2015-02-23 14:03:39 -05:00
PeeHaa
14a4fc054a Fixed typo 2015-02-21 16:10:25 +01:00
PeeHaa
2631403ecd Fixed NativeReactor example by making the reactor instance available in scope 2015-02-21 15:59:07 +01:00
PeeHaa
916306533a Fixed two typos 2015-02-21 15:40:38 +01:00
Daniel Lowrey
3eebc1740d Merge pull request #22 from staabm/patch-2
Fixed typo
2015-02-19 23:11:03 -05:00
Markus Staab
2a1c086390 Fixed typo
Credits to @bwoebi
2015-02-18 20:14:41 +01:00
Daniel Lowrey
446e09a95d Update changelog for v0.16.0 2015-02-18 09:59:48 -05:00
Daniel Lowrey
a573e195a6 Allow null implicit yields 2015-02-18 09:53:55 -05:00
Daniel Lowrey
15a5e08f75 Move guide doc into main directory 2015-02-08 23:36:32 -05:00
Daniel Lowrey
d4a6317010 Add guide docs to main repo 2015-02-06 01:31:22 -05:00
Daniel Lowrey
913295dc6b Merge branch 'lyrixx-psr' 2015-02-05 23:55:32 -05:00
Daniel Lowrey
24acba4486 Merge branch 'psr' of https://github.com/lyrixx/amp into lyrixx-psr 2015-02-05 23:54:12 -05:00
Daniel Lowrey
b1a5d113a8 Add tests for Promisor::update() 2015-02-05 23:44:11 -05:00
Daniel Lowrey
d9f46da021 Merge pull request #20 from lyrixx/composer2
Removed useless configuration in composer.json
2015-02-05 14:03:36 -05:00
Grégoire Pineau
01d50d10f9 Fixex typos 2015-02-05 18:17:05 +01:00
Grégoire Pineau
63305d486f Removed useless configuration in composer.json 2015-02-05 14:40:18 +01:00
Daniel Lowrey
99e38762a7 - Added Reactor::coroutine() method
- Added `Amp\coroutine()` function
- `YieldCommands` "enum" constant class removed -- yield keys now live in
  the reactor class
- New optional `"coroutine"` yield key for self-documenting generator
  yields.
- New optional `"async"` yield key for self-documenting promise yields.
- New `"return"` yield key for specifying the return value of a resolved
  Generator coroutine. If not specified a resolved coroutine result is
  equal to null.
- The final value yielded by a resolved `Generator` is *no longer* used
  as its "return" value. Instead, generators must manually use the new
  `"return"` yield key specifically to designate the value that should
  be used to resolve the promise associated with generator resolution.
- `GeneratorResolver` trait renamed to `CoroutineResolver` and is now an
  abstract class extended by the various `Reactor` implementations.
- Implicit "all" array combinator resolution is now removed. Use the
  explicit form instead:

```php
function() {
    list($a, $b, $c) = (yield 'all' => [$promise1, $promise2, $promise3]);
};
```
2015-02-03 19:41:15 -05:00
Daniel Lowrey
7e451251ab Make Amp\Struct abstract to better represent its purpose 2015-01-28 22:30:02 -05:00
Daniel Lowrey
dcfe12cad8 update contribution guidelines 2015-01-26 12:22:15 -05:00
Daniel Lowrey
ab89cb1595 Remove unused variable 2015-01-21 20:19:47 -05:00
Daniel Lowrey
fb60221dcd Correctly re-enable stream polls in UvReactor 2015-01-21 20:16:33 -05:00
Daniel Lowrey
5f81b096bf Merge pull request #18 from staabm/patch-1
Removed unused var
2015-01-21 17:50:00 -05:00
Markus Staab
474c636845 Removed unused var 2015-01-21 23:00:41 +01:00
Daniel Lowrey
313e3d3a61 Update CHANGELOG 2015-01-21 16:00:20 -05:00
Daniel Lowrey
407edd32cd Merge branch 'bwoebi-master' 2015-01-21 15:58:37 -05:00
Bob Weinand
2ff42636aa Fix waiting for immediates resolution
If there are immediates generated in immediates, they have to wait until next tick - which may only be triggered in far future or never, depending on if there are other read/writeWatchers or timers So, now just do a single event run without blocking if there are new immediates generated during immediates execution
2015-01-21 21:39:12 +01:00
Daniel Lowrey
abbbb6425d Update CHANGELOG 2015-01-18 20:16:02 -05:00
Daniel Lowrey
9edef1d5a7 Fix UvReactor notices 2015-01-18 20:13:08 -05:00
Daniel Lowrey
45c1a9ab3a Merge pull request #16 from douggr/issue-14
Throws a RuntimeException if php-uv or libevent is not loaded.
2015-01-15 19:33:15 -05:00
Douglas G.R
cf3e13a595 Throws a RuntimeException if php-uv or libevent is not loaded.
Using UvReactor or LibeventReactor directly (instead of Amp\getReactor)
doesn't check if php-uv/libevent is loaded and dies with a 'Call to undefined
function' message.
2015-01-06 00:01:07 -02:00
Daniel Lowrey
b1ffd3c918 Merge branch 'douggr-fix-deprecard-in-examples' 2015-01-05 14:19:51 -05:00
Douglas G.R
4092730b74 Asyncronously read from client and broadcast to others.
echo server example (run in terminal):
  - start the service
  php 007_broadcast_server.php

  - Connect to 127.0.0.1 at port 1337 from various terminals;
  nc 127.0.0.1 1337

  - Type in anything and press ENTER; Reactor will asyncronously read
    from client and broadcast to others.
2014-12-26 17:59:51 -02:00
Douglas G.R
badb741c81 Should use Amp\run directly instead of Amp\getReactor()->run.
- Amp\run implicitly creates the reactor.
2014-12-26 15:41:25 -02:00
Douglas G.R
4c791d5952 Fix all deprecated warnings in examples. 2014-12-26 15:29:51 -02:00
Daniel Lowrey
a99b923819 Remove superfluous if conditional 2014-12-08 11:56:26 -05:00
Daniel Lowrey
c21068fc94 Update changelog 2014-12-08 11:52:09 -05:00
Daniel Lowrey
0360aec301 Fix NativeReactor::tick() weirdness 2014-12-08 09:50:16 -05:00
Daniel Lowrey
bbfca9f7ac Avoid unnecessary uv_timer_stop() when cleaning up once timers 2014-12-05 00:09:47 -05:00
Daniel Lowrey
49b7a73a8d Minor libevent reactor bugfixes 2014-12-04 19:30:23 -05:00
Daniel Lowrey
b11e7a0fd1 Fix combinator function derps (again) 2014-12-04 18:08:13 -05:00
Daniel Lowrey
b93238eb1b Fix bad instantiation class name 2014-12-04 17:59:27 -05:00
Daniel Lowrey
a8fe6e2e39 Fix combinator function derps 2014-12-04 13:34:42 -05:00
Daniel Lowrey
8dce4b291c Remove docs in favor of gh-pages version 2014-12-03 11:00:57 -05:00
Daniel Lowrey
4815320764 Update documentation 2014-12-03 11:00:20 -05:00
Daniel Lowrey
d795923318 Handle "@" yield key as implicit "nowait" 2014-12-02 14:47:51 -05:00
Daniel Lowrey
934d1aeffb Return promise/result from bound functions 2014-12-02 12:43:00 -05:00
Daniel Lowrey
ec7b77d156 Update CHANGELOG 2014-12-02 11:52:56 -05:00
Daniel Lowrey
62de0cbc18 Implement 'bind' yield command 2014-12-02 11:52:41 -05:00
Daniel Lowrey
090bdf55ed Rename "wait" yield command -> "pause" to avoid confusion with "nowait" and Amp\wait() 2014-12-02 11:29:19 -05:00