1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 12:35:02 +01:00
Commit Graph

130 Commits

Author SHA1 Message Date
Daniel Lowrey
953c4612e6 Future -> Deferred 2015-05-19 00:21:33 -04:00
Daniel Lowrey
3af013d418 Expose boolean AMP_DEBUG for performance tuning
Amp Future instances double both as Promisor and Promise
implementations when AMP_DEBUG is defined and set to false.
This switch allows private Promise resolution safety by
default at the expense of performance.

Amp applications should set AMP_DEBUG to false in production
environments to maximize performance.
2015-05-18 23:57:34 -04:00
Daniel Lowrey
0973bba5ef Add PromiseStream to stream Promise updates without callback hell 2015-05-18 17:39:09 -04:00
Daniel Lowrey
02e85b29c6 Fix high cpu usage in timer loop from broken "nextTimerAt" caching 2015-05-18 11:40:09 -04:00
Daniel Lowrey
aa27ab7a10 Fixed bug causing every NativeReactor tick to last one second (lol) 2015-05-17 19:52:41 -04:00
Daniel Lowrey
631a6089d9 Resolve correct Success arg in empty any\(\) combinator 2015-05-15 15:59:57 -04:00
Daniel Lowrey
93eb8ad8de Suggest nearby property name in Struct error messages 2015-05-13 10:05:56 -04:00
Daniel Lowrey
2c3a3e65bd Add offending generator key to coroutine resolution error messages 2015-05-13 01:15:35 -04:00
Daniel Lowrey
4a45502ae9 Correctly update nextTimerAt timestamp for repeat watchers 2015-05-10 02:36:39 -04:00
Daniel Lowrey
ed6084c333 Fix incorrect additional increment 2015-05-10 00:54:02 -04:00
Daniel Lowrey
cddb8e9f08 Backport API changes to 5.5+ compat 2015-05-04 12:48:29 -04:00
Daniel Lowrey
b9819d85b4 kill reference to removed function 2015-04-29 13:45:06 -04:00
Daniel Lowrey
06981ab6ea fix bad anon class syntax 2015-04-29 11:24:26 -04:00
Daniel Lowrey
1565e23d46 replace call_user_func() reference 2015-04-27 14:33:41 -04:00
Daniel Lowrey
7cb09edf29 Use anonymous classes 2015-04-27 14:33:17 -04:00
Daniel Lowrey
446eded441 Remove superfluous parameter 2015-04-27 14:30:07 -04:00
Daniel Lowrey
60f1b4484e update docblock 2015-04-03 12:52:17 -04:00
Daniel Lowrey
812e1fb6b4 Reactor API updates, NativeReactor refactor 2015-04-03 11:56:16 -04:00
Daniel Lowrey
2aa4c0c357 Remove libevent reactor until pecl/libevent supports php7 2015-04-03 11:55:23 -04:00
Daniel Lowrey
b57f6eb6bf Add explanatory comment 2015-03-28 10:05:09 -04:00
Daniel Lowrey
fa080b66aa Remove superfluous is_object() check 2015-03-28 10:03:27 -04:00
Daniel Lowrey
9a1581c91d Bind local vars to closure 2015-03-25 14:17:26 -04:00
Daniel Lowrey
654e82f277 minor cleanup 2015-03-23 11:07:40 -04:00
Daniel Lowrey
6375cdd522 Minor documentation rewording 2015-03-19 12:01:09 -04:00
Daniel Lowrey
abd5d34d92 Remove deprecated ReactorFactory 2015-03-19 11:59:20 -04:00
Daniel Lowrey
203855d22c minor docblock update 2015-03-19 11:39:57 -04:00
Daniel Lowrey
d1b919d9fc Avoid extra Closure instantiation in PrivateFuture 2015-03-19 11:39:38 -04:00
Daniel Lowrey
68185a6cf1 Promisor::update() now accepts variadic args 2015-03-19 11:26:56 -04:00
Daniel Lowrey
cd84401b6f Remove superfluous Reactor::at() method 2015-03-19 11:19:19 -04:00
Daniel Lowrey
af2335cf50 Remove deprecated wait functionality 2015-03-19 11:17:50 -04:00
Daniel Lowrey
16be668192 Add scalar types, update docblocks 2015-03-19 11:15:07 -04:00
Daniel Lowrey
620f798b13 Add new Pause promise 2015-03-18 14:05:27 -04:00
Daniel Lowrey
2e1ef0b739 Implement Closure::call() 2015-03-16 15:03:52 -04:00
Daniel Lowrey
834255163c Refactor coroutine functionality 2015-03-16 15:00:17 -04:00
Daniel Lowrey
a573e195a6 Allow null implicit yields 2015-02-18 09:53:55 -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
Grégoire Pineau
01d50d10f9 Fixex typos 2015-02-05 18:17:05 +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
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
Markus Staab
474c636845 Removed unused var 2015-01-21 23:00:41 +01: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
9edef1d5a7 Fix UvReactor notices 2015-01-18 20:13:08 -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
a99b923819 Remove superfluous if conditional 2014-12-08 11:56:26 -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