diff options
Diffstat (limited to 'lib/sqlalchemy/event/api.py')
| -rw-r--r-- | lib/sqlalchemy/event/api.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/sqlalchemy/event/api.py b/lib/sqlalchemy/event/api.py index e7c30901f..260d6e86f 100644 --- a/lib/sqlalchemy/event/api.py +++ b/lib/sqlalchemy/event/api.py @@ -64,6 +64,13 @@ def listen(target, identifier, fn, *args, **kw): .. versionadded:: 0.9.4 Added ``once=True`` to :func:`.event.listen` and :func:`.event.listens_for`. + .. warning:: The ``once`` argument does not imply automatic de-registration + of the listener function after it has been invoked a first time; a + listener entry will remain associated with the target object. + Associating an arbitrarily high number of listeners without explictitly + removing them will cause memory to grow unbounded even if ``once=True`` + is specified. + .. note:: The :func:`.listen` function cannot be called at the same time @@ -124,6 +131,13 @@ def listens_for(target, identifier, *args, **kw): .. versionadded:: 0.9.4 Added ``once=True`` to :func:`.event.listen` and :func:`.event.listens_for`. + .. warning:: The ``once`` argument does not imply automatic de-registration + of the listener function after it has been invoked a first time; a + listener entry will remain associated with the target object. + Associating an arbitrarily high number of listeners without explictitly + removing them will cause memory to grow unbounded even if ``once=True`` + is specified. + .. seealso:: :func:`.listen` - general description of event listening |
