Commit 23ea761f authored by Paul Dardeau's avatar Paul Dardeau
Browse files

Changed batch id counter to be class variable instead of instance variable

parent 19252e1d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ class BaseClient(object):
    # drive default
    USER_ID = 1
    CLIENT_SECRET = 'asdfasdf'
    _batch_id = 0

    def __init__(self, hostname=HOSTNAME, port=PORT, identity=USER_ID,
                 cluster_version=None, secret=CLIENT_SECRET,
@@ -130,7 +131,6 @@ class BaseClient(object):
            self._socket.settimeout(self.socket_timeout)

            self._sequence = itertools.count()
            self._batch_id = itertools.count()
            self._closed = False
        except:
            self._socket = None
@@ -181,7 +181,6 @@ class BaseClient(object):
        self._socket = None
        self.connection_id = None
        self._sequence = itertools.count()
        self._batch_id = itertools.count()


    def update_header(self, command):
@@ -369,7 +368,8 @@ class BaseClient(object):
        self.network_send(header, value)

    def next_batch_id(self):
        return self._batch_id.next()
        BaseClient._batch_id += 1
        return BaseClient._batch_id

    ### with statement support ###