1
0
mirror of https://github.com/danog/amp.git synced 2024-12-13 18:07:30 +01:00
Commit Graph

49 Commits

Author SHA1 Message Date
Daniel Lowrey
d6b674b93b Move coroutine functions into new Coroutine class 2015-07-21 16:14:50 -04:00
Daniel Lowrey
7ce6734976 Fix potential illegal offset access 2015-06-10 15:32:02 -04:00
Daniel Lowrey
05e3ecc423 Fix bug incorrectly clearing repeat watcher when disabled 2015-05-26 03:03:32 -04:00
Daniel Lowrey
71f9687cff Reactor watcher option "callback_data" renamed "cb_data" 2015-05-20 15:21:59 -04:00
Daniel Lowrey
ca82ac5362 Fix NativeReactor bug breaking tick sleep timing 2015-05-19 16:13:53 -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
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
06981ab6ea fix bad anon class syntax 2015-04-29 11:24:26 -04:00
Daniel Lowrey
7cb09edf29 Use anonymous classes 2015-04-27 14:33:17 -04:00
Daniel Lowrey
812e1fb6b4 Reactor API updates, NativeReactor refactor 2015-04-03 11:56:16 -04:00
Daniel Lowrey
cd84401b6f Remove superfluous Reactor::at() method 2015-03-19 11:19:19 -04:00
Daniel Lowrey
16be668192 Add scalar types, update docblocks 2015-03-19 11:15:07 -04:00
Daniel Lowrey
834255163c Refactor coroutine functionality 2015-03-16 15:00:17 -04: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
Markus Staab
474c636845 Removed unused var 2015-01-21 23:00:41 +01: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
ba55ae360f Fix minor inconsistency Reactor::stop() called from immediately watcher 2014-12-02 01:09:51 -05:00
Daniel Lowrey
dd1cbf8ca1 Merge branch 'debugInfo'
Conflicts:
	lib/LibeventReactor.php
	lib/NativeReactor.php
	lib/UvReactor.php
2014-12-02 01:06:36 -05:00
Daniel Lowrey
14c209012c Add Reactor::__debugInfo() for easier debugging 2014-12-02 00:45:12 -05:00
Daniel Lowrey
0d7ab5fc6c Add Reactor::onError, correctly exit extension reactor loops, replace resolve function with trait 2014-12-01 18:12:26 -05:00
Daniel Lowrey
f686691892 Add Reactor::tick() 2014-11-26 15:53:18 -05:00
Daniel Lowrey
6d5e15d662 Apply boolean DeMorgan simplification 2014-11-26 15:49:14 -05:00
Chris Wright
c6b5d4fd17 Don't stop when there are immediates left 2014-11-26 17:03:18 +00:00
Daniel Lowrey
c75a8514a1 Reactor is now optional for combinator functions 2014-11-25 12:46:29 -05:00
Daniel Lowrey
1cb293b776 Remove Combinator/Resolver in favor of functions
This commit removes the Combinator and Resolver classes altogether.
The relevant functionality is now concentrated entirely in the
analogous functions:

- all()
- some()
- any()
- first()
- map()
- filter()
- resolve()

Additionally, all Promisor implementations now *require* a Reactor
upon instantiation. Previously this parameter could be null and the
static singleton reactor instance would be used automatically.
2014-11-24 23:14:07 -05:00
Daniel Lowrey
c28e143828 Remove watchStream() ... aliases are bad 2014-11-05 11:50:46 -05:00
Daniel Lowrey
634d978aeb Simplify reactor onStart() callback invocation 2014-10-22 18:14:01 -04:00
Daniel Lowrey
b73a33da63 Fix bug causing immediate() callback starvation 2014-09-24 12:22:24 -04:00
Daniel Lowrey
7064ec5dc8 Migrate repo to amphp/amp 2014-09-23 00:06:03 -04:00
Daniel Lowrey
56e720cd50 Merge concurrency primitives 2014-09-22 22:21:22 -04:00
Daniel Lowrey
df47c6f09b Use string watcher IDs 2014-08-22 14:08:31 -04:00
Daniel Lowrey
c7c5b0ba8f Standardize all watcher invocation params to: func($reactor, $watcherId, $data) 2014-08-09 10:30:32 -04:00
Daniel Lowrey
c1521d6d7c Always execute immediately watchers in fresh call stack 2014-08-08 14:23:00 -04:00
Daniel Lowrey
58137cdb32 Add docblocks 2014-08-08 12:26:08 -04:00
Daniel Lowrey
d71d9cd564 lowercase NULLs 2014-08-07 01:35:05 -04:00
Daniel Lowrey
2dfc44e548 Reactor::at() now accepts unix timestamp as well as strtotime() parsable string 2014-08-06 21:29:08 -04:00
Daniel Lowrey
75e43cdcf8 Reorder Reactor::watchStream() params 2014-08-06 15:52:43 -04:00
Daniel Lowrey
5878430a0c Update Reactor WATCH constants, remove Reactor::POLL_SOCK 2014-08-06 00:25:47 -04:00
Daniel Lowrey
d5b6266a82 Pass Reactor instance to onStart callbacks 2014-07-18 16:56:02 -04:00
Daniel Lowrey
c2b311eebb Miscellaneous changes 2014-06-11 12:24:46 -04:00
Daniel Lowrey
4fda4967b2 Fix broken Reactor::at millisecond resolutions 2014-06-11 10:08:19 -04:00
Daniel Lowrey
b0a76277bb Fix endless native loop when no watchers remain 2014-06-11 10:03:44 -04:00
Daniel Lowrey
7b351454f9 Minor edge-case updates 2014-04-14 17:06:08 -04:00
Daniel Lowrey
885969ff84 Time intervals now expressed in milliseconds (was seconds) 2014-03-07 12:02:03 -05:00
Daniel Lowrey
861cb58023 File structure reorganization 2014-03-06 09:53:16 -05:00