Comments (1)
Hi there, internally the output from each child process gets serialised (see https://github.com/spatie/async/blob/master/src/Runtime/ChildRuntime.php#L28C34-L28C34). This means that whatever you return from the pool task must be serializable by PHP using serialize
.
For your specific example, I'd stream the contents of the AsyncResponse
and return the string instead:
// Get the stream of the AsyncResponse
$stream = $asyncResponse->toStream();
// Read the contents of the stream
$contents = stream_get_contents($stream);
// Close the stream
fclose($stream);
// Return the contents
return $contents;
from async.
Related Issues (20)
- Second process not starting?
- How to use external functions and variables? HOT 2
- Deprecated: Return type of Symfony\Component\Process\Process::getIterator($flags = 0) HOT 1
- Sleep issue HOT 2
- How to echo from the child process? HOT 2
- Bubbling up of exceptions fails HOT 2
- php 8.1.10 is error HOT 1
- Not working as expected after PHP 8.2 update HOT 5
- Typed property error HOT 2
- What can I do I got `Pool::isSupported()` false. HOT 1
- Issue with SIGCHLD handling in PHP Version 8.1.24 HOT 3
- sh: line 0: exec: php: not found HOT 2
- Error The DateTime object has not been correctly initialized by its constructor.
- Deadcode on Pool ? HOT 2
- Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given
- PHP Warning: Failed to set memory limit to 0 bytes (Current memory usage is 2097152 bytes) in Unknown on line 0
- how to integrated with laravel HOT 2
- how to get the $output from Task
- Laravel $app returns true instead of Illuminate\Foundation\Application on production server inside a Task class
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async.