code: function() {
            _ws.onmessage = function(response) {
              var data = JSON.parse(response.data);
              self.postMessage(data);
            };
          }
docs: Listens for any message coming from the WebSocket
  and send its content to the main JS thread using postMessage[1].
  
  [1]: https://developer.mozilla.org/en-US/docs/Web/API/Worker.postMessage