import logging

from channels.generic.websocket import WebsocketConsumer


logger = logging.getLogger(__name__)


class CustomConsumer(WebsocketConsumer):
    def connect(self):
        self.accept()

    def receive(self, text_data=None, bytes_data=None):
        self.send('1. response: {}'.format(text_data))
        self.send('2. response: {}'.format(text_data))

    def disconnect(self, code):
        pass
