(handlers, mux)
| 532 | |
| 533 | |
| 534 | def runonce(handlers, mux): |
| 535 | r = [] |
| 536 | w = [] |
| 537 | x = [] |
| 538 | to_remove = filter(lambda s: not s.ok, handlers) |
| 539 | for h in to_remove: |
| 540 | handlers.remove(h) |
| 541 | |
| 542 | for s in handlers: |
| 543 | s.pre_select(r,w,x) |
| 544 | debug2('Waiting: %d r=%r w=%r x=%r (fullness=%d/%d)\n' |
| 545 | % (len(handlers), _fds(r), _fds(w), _fds(x), |
| 546 | mux.fullness, mux.too_full)) |
| 547 | (r,w,x) = select.select(r,w,x) |
| 548 | debug2(' Ready: %d r=%r w=%r x=%r\n' |
| 549 | % (len(handlers), _fds(r), _fds(w), _fds(x))) |
| 550 | ready = r+w+x |
| 551 | did = {} |
| 552 | for h in handlers: |
| 553 | for s in h.socks: |
| 554 | if s in ready: |
| 555 | h.callback() |
| 556 | did[s] = 1 |
| 557 | for s in ready: |
| 558 | if not s in did: |
| 559 | raise Fatal('socket %r was not used by any handler' % s) |
nothing calls this directly
no test coverage detected