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
{{ message }}
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.
This could be done with a Pipe class added to a JS function:
useNesk\Rialto\Data\JsFunction;
useNesk\Rialto\Data\Pipe;
// Create a new pipe to transfer values from JS to PHP$pipe = newPipe;
// Create a JS function with the pipe$jsFunction = JsFunction::createWithBody(" const value = { foo: 'bar' } customPipe.sendValue(value)")->addPipe('customPipe', $pipe);
// Use the JS function with Rialto's implementation...// Retrieve the transfered values through an iteratorforeach ($pipeas$value) {
var_dump($value); // Outputs: array(1) { 'foo' => string(3) "bar" }
}
Each time the iterator of the Pipe class is called, the next value will be retrieved by communicating with the Node process. Once the value is retrieved, the Node process deletes it and will no longer be available.
The text was updated successfully, but these errors were encountered:
This could be done with a
Pipe
class added to a JS function:Each time the iterator of the
Pipe
class is called, the next value will be retrieved by communicating with the Node process. Once the value is retrieved, the Node process deletes it and will no longer be available.The text was updated successfully, but these errors were encountered: