Commit Graph

9 Commits (a6387f69a8f387e6e4a2d552b9d10c96da1e34d0)

Author SHA1 Message Date
David Wilson ecc570cbda select: make Select.add() handle multiple buffered items.
Previously given something like:

    l = mitogen.core.Latch()
    l.put(1)
    l.put(2)

    s = mitogen.select.Select([l], oneshot=False)
    assert 1 == s.get(block=False)
    assert 2 == s.get(block=False)

The second call would throw TimeoutError, because Select.add() only
queued the receiver/latch once if it was non-empty, rather than once for
each item as should happen.
5 years ago
David Wilson b3f592acee issue #535: core/select: support selecting from Latches. 6 years ago
David Wilson 6fafc0a631 select: Python 2.x required __nonzero__ for bool(Select) 6 years ago
David Wilson ddf28987a0 master: split Select() into new module to reduce wire size.
service.py currently imports master.py(+parent.py) just to get Select().
7 years ago
David Wilson dd088908df select: clean up API. 7 years ago
Alex Willmer 7e01c5bed5 Import and use unittest2 without aliasing it 7 years ago
Alex Willmer 17da6e9998 Use unittest2 in all tests
This allows using features such as TestCase,assertIsInstance on Python
2.6 and earlier.
7 years ago
David Wilson 849ccebe04 receiver: only permit one notify callback
There is no point spamming a list for every function call, there is no
use case where multiple notify callbacks would be useful.
7 years ago
David Wilson f869e088f8 issue #20: tests and fixes for mitogen.master.Select(). 7 years ago