From ca63c26e0141fcf9a2d4018525a7182d7b7a3653 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 14 Feb 2019 14:58:55 +0000 Subject: [PATCH] core: Make Latch.put(obj=) optional. --- mitogen/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mitogen/core.py b/mitogen/core.py index cfdf996b..dcca2e91 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -2240,11 +2240,14 @@ class Latch(object): finally: self._lock.release() - def put(self, obj): + def put(self, obj=None): """ Enqueue an object, waking the first thread waiting for a result, if one exists. + :param obj: + Object to enqueue. Defaults to :data:`None` as a convenience when + using :class:`Latch` only for synchronization. :raises mitogen.core.LatchError: :meth:`close` has been called, and the object is no longer valid. """