Commit Graph

10 Commits (a8317c2393b5986b9afbfb20e378c16cbb096582)

Author SHA1 Message Date
Alex Willmer a8317c2393 tests: Remove unittest2, use stdlib unittest
unittest2 is incomplatible with Python 3.10
2 years ago
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. 5 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().
6 years ago
David Wilson dd088908df select: clean up API. 6 years ago
Alex Willmer 7e01c5bed5 Import and use unittest2 without aliasing it 6 years ago
Alex Willmer 17da6e9998 Use unittest2 in all tests
This allows using features such as TestCase,assertIsInstance on Python
2.6 and earlier.
6 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.
6 years ago
David Wilson f869e088f8 issue #20: tests and fixes for mitogen.master.Select(). 6 years ago