Icicle v0.8.0 Release NotesRelease Date: 2015-08-15 // almost 7 years ago
🆕 New Features
- 0️⃣ The default event loop can be swapped during execution. Normally this is not recommended and will break a program, but it can be useful in certain circumstances (forking, threading).
- ➕ Added the function
Icicle\Loop\with()that accepts a function that is run in a separate loop from the default event loop (a specific loop instance can be provided to the function). The default loop is blocked while running the loop.
setCallback()method that allows the callback invoked when an event occurs to be swapped without needing to create a new event.
- The cancellation callable is no longer passed to the
Icicle\Promise\Promiseconstructor, it should be returned from the resolver function passed to the constructor. This change was made to avoid the need to create reference variables to share values between functions. Instead values can just be used in the cancellation function returned from the resolver. The resolver function must return a
- Cancelling a promise is now an asynchronous task. Calling
Icicle\Promise\Promise::cancel()does not immediately call the cancellation method (if given), it is called later (like a function registered with
Icicle/Promise/PromiseInterfacenow includes an
isCancelled()method. When a promise is cancelled, this method will return true once the promise has been cancelled. Note that if a child promise is rejected due to an
$onRejectedcallable throwing after cancelling the parent promise,
isCancelled()of the child promise will return false because the promise was not cancelled, it was rejected from the
- 🛠 Fixed issue where
Icicle\Loop\SelectLoopwould not dispatch a signal while blocking. The issue was fixed by adding a periodic timer that checks for signals that may have arrived. The interval of this timer can be set with