<commit_before>'use strict';

var common = require('../saymon-common.js');

/**
 * A basic actor.
 */
class Actor {
  /**
   * @param {ActorSystem} system Actor system.
   */
  constructor(system) {
    this.system = system;
  }

  /**
   * Creates a child actor.
   *
   * @param {Object} behaviour Child actor behaviour definition.
   * @param {Object} [options] Actor creation options.
   * - {String} mode Actor creation mode.
   * @returns {P} Promise that yields a child actor once it is created.
   */
  createChild(behaviour, options) {
    return this.system.createActor(behaviour, this, options);
  }

  /**
   * @returns {String} This actor ID.
   */
  getId() {
    return common.abstractMethodError('getId');
  }

  /**
   * Sends a message to this actor. The message is handled according to specified behaviour.
   *
   * @param {String} topic Message topic.
   * @param message Message.
   * @returns {P} Promise which is resolved once the message is sent.
   */
  send(topic, message) {
    return common.abstractMethodError('send', topic, message);
  }

  /**
   * Sends a message to this actor and receives a response. The message is handled according
   * to specified behaviour.
   *
   * @param {String} topic Message topic.
   * @param message Message.
   * @returns {P} Promise which yields the actor response.
   */
  sendAndReceive(topic, message) {
    return common.abstractMethodError('sendAndReceive', topic, message);
  }

  /**
   * Destroys this actor.
   *
   * @returns {P} Promise which is resolved when actor is destroyed.
   */
  destroy() {
    return common.abstractMethodError('destroy');
  }

  toString() {
    return 'Actor(' + this.id + ')';
  }
}<commit_msg>(saymon) data-server-cluster: Added test for ForkedActor.destroy().<commit_after>'use strict';

var common = require('../saymon-common.js');

/**
 * A basic actor.
 */
class Actor {
  /**
   * @param {ActorSystem} system Actor system.
   */
  constructor(system) {
    this.system = system;
  }

  /**
   * Creates a child actor.
   *
   * @param {Object} behaviour Child actor behaviour definition.
   * @param {Object} [options] Actor creation options.
   * - {String} mode Actor creation mode.
   * @returns {P} Promise that yields a child actor once it is created.
   */
  createChild(behaviour, options) {
    return this.system.createActor(behaviour, this, options);
  }

  /**
   * @returns {String} This actor ID.
   */
  getId() {
    return common.abstractMethodError('getId');
  }

  /**
   * Sends a message to this actor. The message is handled according to specified behaviour.
   *
   * @param {String} topic Message topic.
   * @param message Message.
   * @returns {P} Promise which is resolved once the message is sent.
   */
  send(topic, message) {
    return common.abstractMethodError('send', topic, message);
  }

  /**
   * Sends a message to this actor and receives a response. The message is handled according
   * to specified behaviour.
   *
   * @param {String} topic Message topic.
   * @param [message] Message.
   * @returns {P} Promise which yields the actor response.
   */
  sendAndReceive(topic, message) {
    return common.abstractMethodError('sendAndReceive', topic, message);
  }

  /**
   * Destroys this actor.
   *
   * @returns {P} Promise which is resolved when actor is destroyed.
   */
  destroy() {
    return common.abstractMethodError('destroy');
  }

  toString() {
    return 'Actor(' + this.id + ')';
  }
}
{'fraction_non_alphanumeric': 0.12622761409589833, 'fraction_numerical': 0.0, 'mean_word_length': 2.9531963470319633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4563045', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1015, 'n_words': 335}