You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will be good if we can catch of the worker exceptions. For example:
$wp = new WorkerPool();
$wp->onWorkerException(function(\Exception $ex, Worker $worker) {
// there we can handle the exception (logging, restart the task or other)
});
The text was updated successfully, but these errors were encountered:
The fun part is that you need to serialize exceptions in order to send them via the pipe. Just did this myself. Any ressource or object anywhere either directly as a function parameter or in some nested array/object hierarchy will make the serialization fail. so you will have to iterate recursively through the stack and the objects to remove any non-serializable data. And as objects are references only you will modify the state of your worker. Really funny is PDO which implements __sleep() and just throws an error.
You get already the stacktrace as string as well as the message as return result.
We avoid serializing the whole stack by serializing the string stack trace only.
Will be good if we can catch of the worker exceptions. For example:
The text was updated successfully, but these errors were encountered: