# Path: tapes/distributed/proxy.py
# class MetricsProxy(object):
#     def __init__(self, socket):
#         self.socket = socket
# 
#     def send(self, message):
#         distributed_logger.debug('Sending message %s', message)
#         self.socket.send_pyobj(message)
# 
# Path: tapes/distributed/message.py



from .proxy import MetricsProxy
from .message import Message


class CounterProxy(MetricsProxy):
    def __init__(self, socket, name):
        super(CounterProxy, self).__init__(socket)
        self.name = name

    def increment(self, n=1):
        self.send(Message('counter', self.name, n))

    def decrement(self, n=1):

# Path: tapes/distributed/proxy.py
# class MetricsProxy(object):
#     def __init__(self, socket):
#         self.socket = socket
# 
#     def send(self, message):
#         distributed_logger.debug('Sending message %s', message)
#         self.socket.send_pyobj(message)
# 
# Path: tapes/distributed/message.py



# Path: tapes/distributed/counter.py
from .proxy import MetricsProxy
from .message import Message



class CounterProxy(MetricsProxy):
    def __init__(self, socket, name):
        super(CounterProxy, self).__init__(socket)
        self.name = name

    def increment(self, n=1):
        self.send(Message('counter', self.name, n))

    def decrement(self, n=1):

        self.send(Message('counter', self.name, -n))