<commit_before>part of comet;

class CometSocket {
  /// The websocket associated with the user
  final WebSocket _socket;
  final SessionManager _sessionManager;

  /// Create a new [CometSocket] for the given [WebSocket].
  CometSocket(this._socket, this._sessionManager);

  void _registerSocketEventHandlers() {
    // Set on connection event
    Session session;
    String user;

    _socket.listen((data) {
      var msg = new Message.fromJson(data);
      stdout.writeln(data);

      switch (msg.type) {
        case MessageType.connect:
          var config = new IrcConfig.fromMap(msg.body);
          session = _sessionManager.newSession(config, user);

          session.listen((msg) => _socket.add(JSON.encode(msg)));

          break;<commit_msg>Actually do things in CometSocket<commit_after>part of comet;

class CometSocket {
  /// The websocket associated with the user
  final WebSocket _socket;
  final SessionManager _sessionManager;

  /// Listen to the [_socket] for messages.
  CometSocket(this._socket, this._sessionManager) {
    // Set on connection event
    Session session;
    String user;

    _socket.listen((data) {
      var msg = new Message.fromJson(data);
      stdout.writeln(data);

      switch (msg.type) {
        case MessageType.connect:
          var config = new IrcConfig.fromMap(msg.body);
          session = _sessionManager.newSession(config, user);

          session.listen((msg) => _socket.add(JSON.encode(msg)));

          break;
{'fraction_non_alphanumeric': 0.1016150740242261, 'fraction_numerical': 0.0, 'mean_word_length': 2.933862433862434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3342318', 'n_tokens_mistral': 432, 'n_tokens_neox': 413, 'n_words': 113}