<commit_before><?hh

namespace Hack\UserDocumentation\API\Examples\AsyncMysql\ConnPool\construct;

require __DIR__ . "/../connect.inc.php";

use \Hack\UserDocumentation\API\Examples\AsyncMysql\ConnectionInfo as CI;

function set_connection_pool(array $options): \AsyncMysqlConnectionPool {
  return new \AsyncMysqlConnectionPool($options);
}

async function connect_with_pool(\AsyncMysqlConnectionPool $pool):
  Awaitable<\AsyncMysqlConnection> {
  return await $pool->connect(
    CI::$host,
    CI::$port,
    CI::$db,
    CI::$user,
    CI::$passwd
  );
}

function get_stats(\AsyncMysqlConnectionPool $pool): array<mixed> {
  return $pool->getPoolStats();
}

function run_it(): void {
  $options = array(
    'pool_connection_limit' => 2,
  );
   // We will have a 2 pool connection limit<commit_msg>Fix typing for AsyncMysqlConnectionPool::__construct example<commit_after><?hh

namespace Hack\UserDocumentation\API\Examples\AsyncMysql\ConnPool\construct;

require __DIR__ . "/../connect.inc.php";

use \Hack\UserDocumentation\API\Examples\AsyncMysql\ConnectionInfo as CI;

function set_connection_pool(array $options): \AsyncMysqlConnectionPool {
  return new \AsyncMysqlConnectionPool($options);
}

async function connect_with_pool(\AsyncMysqlConnectionPool $pool):
  Awaitable<\AsyncMysqlConnection> {
  return await $pool->connect(
    CI::$host,
    CI::$port,
    CI::$db,
    CI::$user,
    CI::$passwd
  );
}

function get_stats(\AsyncMysqlConnectionPool $pool): array<string, int> {
  return $pool->getPoolStats();
}

function run_it(): void {
  $options = array(
    'pool_connection_limit' => 2,
  );
   // We will have a 2 pool connection limit
{'fraction_non_alphanumeric': 0.13064419024683926, 'fraction_numerical': 0.002408187838651415, 'mean_word_length': 4.852112676056338, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '3146519', 'n_tokens_mistral': 558, 'n_tokens_neox': 546, 'n_words': 106}