Skip to content

Commit 5bdd183

Browse files
committed
merged transaction-commit-bug into main
2 parents a7a605d + 75fbe0f commit 5bdd183

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/Bolt/BoltConnection.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,19 @@ final class BoltConnection implements ConnectionInterface
4646
private BoltFactory $factory;
4747

4848
private string $serverState = 'DISCONNECTED';
49-
/** @var list<WeakReference<CypherList>> */
49+
/**
50+
* @note We are using references to "subscribed results" to maintain backwards compatibility and try and strike
51+
* a balance between performance and ease of use.
52+
* The connection will discard or pull the results depending on the server state transition. This way end
53+
* users don't have to worry about consuming result sets, it will all happen behind te scenes. There are some
54+
* edge cases where the result set will be pulled or discarded when it is not strictly necessary, and we
55+
* should introduce a "manual" mode later down the road to allow the end users to optimise the result
56+
* consumption themselves.
57+
* A great moment to do this would be when neo4j 5 is released as it will presumably allow us to do more
58+
* stuff with PULL and DISCARD messages.
59+
*
60+
* @var list<WeakReference<CypherList>>
61+
*/
5062
private array $subscribedResults = [];
5163

5264
/**

tests/Integration/BoltResultIntegrationTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Laudis\Neo4j\Authentication\Authenticate;
2020
use Laudis\Neo4j\Bolt\BoltConnection;
2121
use Laudis\Neo4j\Bolt\BoltResult;
22+
use Laudis\Neo4j\Bolt\SslConfigurator;
2223
use Laudis\Neo4j\BoltFactory;
2324
use Laudis\Neo4j\Common\ConnectionConfiguration;
2425
use Laudis\Neo4j\Common\Uri;
@@ -59,6 +60,10 @@ public function testIterationLong(string $connection): void
5960
{
6061
$uri = Uri::create($connection);
6162
$socket = new StreamSocket($uri->getHost(), $uri->getPort() ?? 7687);
63+
$options = (new SslConfigurator())->configure($uri, DriverConfiguration::default());
64+
if ($options !== null) {
65+
$socket->setSslContextOptions($options);
66+
}
6267

6368
$i = 0;
6469
$factory = new BoltFactory(new Bolt($socket), Authenticate::fromUrl($uri), '', $socket);

0 commit comments

Comments
 (0)