|
$in = new Decoder($process->stdout, true, 512, 0, 16 * 1024 * 1024); |
has
$in = new Decoder($process->stdout, true, 512, 0, 16 * 1024 * 1024); = 16mb maxlength
|
$in = new Decoder($through); |
and
|
$in = new Decoder(new ReadableResourceStream(\STDIN, $loop)); |
don't supply maxlength to the Decoder constructor, and get the default 65536 from
https://github.com/clue/reactphp-ndjson/blob/60c4f980a4f7fb5d415be2ab4ad4d41522110d19/src/Decoder.php#L33
That feels like a mistake, or is there a reason to limit the worker side so severely?
I ran into this trying to send large statements. I'm by far no reactphp expert, but this seems to be the cause for my problems. If I send a large package, I get a "Database closed" Exception.
a script to demonstrate the problem (works fine for e.g. str_repeat('a', 50000)):
<?php
require 'vendor/autoload.php';
use Clue\React\SQLite\Factory;
$factory = new Factory();
$factory->open(':memory:')->then(function ($db) {
$db->exec('CREATE TABLE t (id INTEGER PRIMARY KEY, test TEXT)');
$db->query('INSERT INTO t (test) VALUES (?)', [str_repeat('a', 100000)])->then(
function () { echo "big insert: OK\n"; exit; },
function (Exception $e) { echo 'big insert rejected: ' . $e->getMessage() . "\n"; }
);
});
reactphp-sqlite/src/Io/ProcessIoDatabase.php
Line 36 in c1bf2a3
has
$in = new Decoder($process->stdout, true, 512, 0, 16 * 1024 * 1024);= 16mb maxlengthreactphp-sqlite/res/sqlite-worker.php
Line 51 in c1bf2a3
and
reactphp-sqlite/res/sqlite-worker.php
Line 55 in c1bf2a3
don't supply maxlength to the Decoder constructor, and get the default 65536 from
https://github.com/clue/reactphp-ndjson/blob/60c4f980a4f7fb5d415be2ab4ad4d41522110d19/src/Decoder.php#L33
That feels like a mistake, or is there a reason to limit the worker side so severely?
I ran into this trying to send large statements. I'm by far no reactphp expert, but this seems to be the cause for my problems. If I send a large package, I get a "Database closed" Exception.
a script to demonstrate the problem (works fine for e.g.
str_repeat('a', 50000)):