Asynchronous coroutines for PHP 7.
fwrite()
error conditions indicated by 0
return value (recoilphp/react#6)This is the first stable release of recoil/recoil
. There have been no changes
to the API since the 1.0.0-alpha.2
release.
select()
API operationUPGRADE WITH CAUTION
As of this version, the recoil/recoil
package only contains the "reference kernel", which is an implementation of the kernel with no external dependencies. As such, it can not be used to execute ReactPHP code.
The ReactPHP kernel is still available in the recoil/react package.
Libraries and applications should be developed against the interfaces and classes provided by recoil/api. The intent is to keep these interfaces as stable as possible across the various kernel implementations and versions.
Api::resume()
and throw()
(added in 0.5.2)Strand::trace()
and setTrace()
methodsApi::suspend()
now accepts an optional terminator callback, which is invoked if the strand is terminated before it is resumedStrandTrace
interface, a low-level strand observer to be used by debugging toolsStrand::send()
and throw()
no longer fail if the strand has already exitedApi::resume()
and throw()
to resume one strand from within another.suspend()
API method which is invoked when a suspended strand is terminated.UPGRADE WITH CAUTION
This is the first release that requires PHP 7. The internals have been rewritten from the ground up. Some features available in previous releases are no longer available as substitute functionality has not yet been added.
There are far too many changes to list here individually, however much of the kernel API remains the same.
Recoil::run()
has been removed (see ReactKernel::start()
).Kernel API changes:
kernel()
has been removed.eventLoop()
is only available when using ReactKernel
.return_()
has been removed, as generators can return values in PHP 7.throw_()
has been removed.finally_()
has been removed.noop()
has been removed.stop()
has been removed.select()
now operates on PHP streams, rather than strands.read()
and write()
callback()
link()
and unlink()
adopt()
any()
, some()
and first()
This is the final release that will operate with PHP 5. In an effort to work towards a production ready 1.0 release, future releases will require PHP 7.
Interface
suffix from interfacesReadableStream
to ReadablePhpStream
WritableStream
to WritablePhpStream
CoroutineAdaptor
to StandardCoroutineAdaptor
KernelApi
to StandardKernelApi
Strand
to StandardStrand
StrandFactory
to StandardStrandFactory
Recoil::suspend
is now optional