twirrdy.protocol.RRDCacheClient

Here are the examples of the python api twirrdy.protocol.RRDCacheClient taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: nagcat Source File: twist.py
Function: open
    def open(self, address, pidfile=None):
        """Open connection to rrdcached

        @param address: path to rrdcached's UNIX socket
        @type address: str
        @param pidfile: optionally check rrdcached's pid file
        @type pidfile: str
        """

        deferred = defer.Deferred()
        self._client = protocol.RRDCacheClient(deferred)
        reactor.connectUNIX(address, self._client, checkPID=pidfile)
        self.update = self._update_cache
        return deferred

Example 2

Project: nagcat Source File: test_protocol.py
Function: set_up
    def setUp(self):
        sock = self.mktemp()
        serverfactory = DummyCacheServer()
        self.server = reactor.listenUNIX(sock, serverfactory)
        deferred = defer.Deferred()
        self.client = protocol.RRDCacheClient(deferred, True)
        reactor.connectUNIX(sock, self.client)
        return deferred