'Prepares a RekallResponse and send to the server.'

def write_data_stream(self):

    if self.data:
        response_msg = rekall_types.RekallResponse(json_messages=self.robust_encoder.encode(self.data), json_context_messages=self.robust_encoder.encode(self.context_messages.items()), plugin=self.plugin)
        self.context_messages = self.new_context_messages
        self.new_context_messages = {}
        self.action.SendReply(response_msg)
