<commit_before>
self.services.register('speak', class {
  static get exposed() { return ['concat']; }

  constructor(prefix) {
    this.prefix_ = prefix;
  }

  concat(message) {
    return this.prefix_ + message;
  }
});<commit_msg>Expose a service from the worker<commit_after>
// Expose a service to the main thread.
self.services.register('speak', class {
  static get exposed() { return ['concat']; }

  constructor(prefix) {
    this.prefix_ = prefix;
  }

  concat(message) {
    return this.prefix_ + message;
  }
});

// We can also connect to services the main thread exposes to us.
(async function() {
  let dom = await self.services.connect('dom');
  dom.appendText('Inside the worker?');
})();
{'fraction_non_alphanumeric': 0.14447592067988668, 'fraction_numerical': 0.0, 'mean_word_length': 3.7449664429530203, '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': '1134471', 'n_tokens_mistral': 223, 'n_tokens_neox': 214, 'n_words': 63}