コード例 #1
0
    def get_routing_client(self):
        """Returns a routing client.  This client is able to automatically
        route the requests to the individual hosts.  It's thread safe and
        can be used similar to the host local client but it will refused
        to execute commands that cannot be directly routed to an
        individual node.

        See :class:`RoutingClient` for more information.
        """
        return RoutingClient(self)
コード例 #2
0
    def get_routing_client(self, auto_batch=True):
        """Returns a routing client.  This client is able to automatically
        route the requests to the individual hosts.  It's thread safe and
        can be used similar to the host local client but it will refused
        to execute commands that cannot be directly routed to an
        individual node.

        The default behavior for the routing client is to attempt to batch
        eligible commands into batch versions thereof.  For instance multiple
        `GET` commands routed to the same node can end up merged into an
        `MGET` command.  This behavior can be disabled by setting `auto_batch`
        to `False`.  This can be useful for debugging because `MONITOR` will
        more accurately reflect the commands issued in code.

        See :class:`RoutingClient` for more information.
        """
        return RoutingClient(self, auto_batch=auto_batch)