Releases: amphp/amp
Releases · amphp/amp
1.0.0
v0.15.0
Additions
- Added
Reactor::__debugInfo()
hook to ease debugging. - Added
Reactor::onError()
exception handling hook to handle asynchronous
errors without breaking the event loop - Added optional boolean
$noWait
parameter toReactor::tick($noWait)
- Added
Amp\getReactor()
andAmp\chooseReactor()
functions - Added
Amp\wait()
to replace deprecatedAmp\Promise::wait()
- Added new
"bind"
yield command
Removals:
- Removed
Combinator
class in favor of combinator functions - Removed
Resolver
class, useGeneratorResolver
trait internally Promisor
implementations no longer have any knowledge of the event reactor.
Deprecations:
- Deprecated
Promise::wait()
. New code should useAmp\wait()
to synchronously
wait for promise completion - Deprecated
Amp\reactor()
function. New code should useAmp\getReactor()
instead - The
ReactorFactory
class is deprecated and scheduled for removal. Please use
theAmp\getReactor()
function instead ofReactorFactory::select()
Bugfixes:
- Correctly break out of the
NativeReactor
run loop immediately when
Reactor::stop()
invoked inside immediately watchers - Correctly exit
UvReactor
andLibeventReactor
run loop when no outstanding
watchers remain active - Other miscellaneous fixes
Other:
- Changed
"wait"
yield command to"pause"
BC BREAKS:
- None
Functions API, easier single-thread use
- Added functions.php API for reactor use in procedural and functional code.
ReactoryFactory::select()
is now a static singleton method. Single-threaded code should never
use multiple event loops. This change is made to easeReactor
procurement and minimize bugs
from the existence of multipleReactor
instances in the same thread. It is NOT, however, an
excuse to forego dependency injection. Do not abuse the global nature of the event loop. Lazy
injection is fine, but laziness on your part as a programmer is not.
BC BREAKS:
- The
ReactorFactory::__invoke()
magic method has been removed. Any code relying on it must migrate
references toReactoryFactory::select()
Add libuv support
This release adds support for Reactor
backends using the php-uv extension as well as other minor features. It contains no BC breaks.