Skip to content
This repository was archived by the owner on Jul 21, 2021. It is now read-only.

Commit fcfa31c

Browse files
committed
Add a note about using a wek dictionary for keeping spans around.
This weak approach would be needed as, as opposed to web frameworks, where you get a well defined lifetime for request objects, we could *potentially* keep many objects around if the user forgets to actually use the statements/connection/session objects.
1 parent 0456ab1 commit fcfa31c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

NOTES.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@ exists for both Connection and Session objects. Sadly, such dictionary
7070
is 'moved' around for every Connection of the parent Engine, thus is
7171
not unique, thus we can't use it for thread scenarios.
7272

73-
One alternative was also to have thread local objects - specifically
73+
A second alternative is to use a weak dictionary - so we keep
74+
the statements/connection/session around, and even if they are
75+
used/ignored/forgotten, we don't keep them around forever. This is
76+
similar to what the Django/Flask/Pyramid connectors do, with the
77+
exception of them having a well defined lifetime for the decorated
78+
objects (the request one).
79+
80+
A third alternative was also to have thread local objects - specifically
7481
to hold the current active span. While this may have worked just fine
7582
for us, this is something that has been done and re-done in other
7683
OT libraries/language. Thus we will wait to see how the eventual

0 commit comments

Comments
 (0)