Skip to content

Commit 496cc76

Browse files
committed
added comment explaining result subscription
1 parent bcbf30b commit 496cc76

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-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
/**

0 commit comments

Comments
 (0)