从基础actor继承时,如何添加到接收匹配?

时间:2017-02-07 18:18:17

标签: akka

我有一个已经接收匹配的基础角色:

class BaseActor()扩展了Actor {   def receive = {    ..   } }

现在,当我扩展它时,如何向接收添加更多部分功能?

function chooseSurv(number, name) {
  var j = number;
  var question = new Array();
  question = survQuestions[j];
  var questionType = new Array();
  questionType = survType[j];
  var outputans = "";
  var outputchart = "";
  var SurveyAnswer = Parse.Object.extend("someclass);
  var query = new Parse.Query(SurveyAnswer); query.descending("createdAt"); query.include("author"); query.include("survey"); query.equalTo("survey", somestring); query.find({
    success: function(results) {
      for (var u = 0; u < question.length; u++) {
        var questions = question[u];
        outputans += '<div id="ansbox">';
        if (questionType[u] / 1) {
          var divid = "chart_div" + j + u;
          console.log(divid);
          outputans += '<div id="' + divid + '" class="chart-box"></div>';
          outputans += '</div>';
          for (var k in results) {
            var answer = results[k].get("data")[u];
            var author = results[k].get("author");
            var name = author.get("name");
            outputans += '<h4>' + name + '</h4>';
            outputans += '<p>' + answer + '</p>';
            outputans += '</div>';
          }
          // Load the Visualization API and the corechart package.
          google.charts.load('current', {
            'packages': ['corechart']
          });
          // Set a callback to run when the Google Visualization API is loaded.
          google.charts.setOnLoadCallback(drawChart);
          // Callback that creates and populates a data table,
          // instantiates the pie chart, passes in the data and
          // draws it.
          function drawChart() {
            // Create the data table.
            var data = new google.visualization.DataTable();
            data.addColumn('string', 'Topping');
            data.addColumn('number', 'Slices');
            data.addRows([
              ['Mushrooms', 3],
              ['Onions', 1],
              ['Olives', 1],
              ['Zucchini', 1],
              ['Pepperoni', 2]
            ]);
            // Set chart options
            var options = {
              'title': 'How Much Pizza I Ate Last Night',
              'width': 400,
              'height': 300
            };
            // Instantiate and draw our chart, passing in some options.
            var chart = new google.visualization.PieChart(document.getElementById(divid));
            chart.draw(data, options);
            console.log(divid);
          }
        } else {

0 个答案:

没有答案