Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(1)  |  Import(0)
The :class:`Dispatcher` class is a thin wrapper around a low-level socket
object. To make it more useful, it has a few methods for event-handling
which are called from the asynchronous loop. Otherwise, it can be treated
as a normal non-blocking socket object.

The firing of low-level events at certain times or in certain connection
states tells the asynchronous loop that certain higher-level events have
taken place. For example, if we have asked for a socket to connect to
another host, we know that the connection has been made when the socket
becomes writable for the first time (at this point you know that you may(more...)

src/a/s/astm-0.5.0/astm/tests/test_asynclib.py   astm(Download)
class dispatcherwithsend_noread(asynclib.Dispatcher):
 
    def __init__(self, sock=None, map=None):
        super(dispatcherwithsend_noread, self).__init__(sock, map)
        self.out_buffer = ''
    def test_basic(self):
        d = asynclib.Dispatcher()
        self.assertEqual(d.readable(), True)
        self.assertEqual(d.writable(), True)
 
    def test_repr(self):
        d = asynclib.Dispatcher()