Repository navigation
1.3.0
Added
- Opt-in
Fork::catch(callable $callback)to handle task exceptions in the parent process. The callback receives the exception and zero-based task order; its return value becomes the task result and reachesafter(parent: ...)(#99). - Handle failures while serializing task return values through the same callback. Serializable exceptions retain their original type and data. Exceptions that cannot be serialized or restored fall back to
Spatie\Fork\Exceptions\TaskFailed, preserving their original class, message, file, line and trace text. - Keep successful data separate from transported exceptions, including strings resembling transport markers and returned exception objects. Exception restoration hooks run only in the parent.
Development
- Test PHP 8.6 alongside PHP 8.3–8.5, and allow Pest 5 in development dependencies (#104).
Compatibility
- PHP 8.3+ requirements and existing
before/aftercallback signatures are unchanged. Withoutcatch(), existing output and exception behavior is unchanged. catch()handles task execution and return-value serialization, not before/after callbacks, parent-side result restoration, transfer failures or unexpected child exit statuses. Exceptions thrown by the catch callback propagate fromrun().- Existing transfer deadlines, child status handling, signal-handler restoration, termination and sibling cleanup policies are unchanged.
Full Changelog: 1.2.12...1.3.0