@andreabiagini5/applicazioni-e-servizi-web-project
Version:
Project for Applicazioni e Servizi Web.
19 lines • 684 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMatchIfPossible = void 0;
const matchmaking_1 = require("../controllers/matchmaking");
const matchmaking_2 = require("../services/matchmaking/matchmaking");
/**
*/
const createMatchIfPossible = async () => {
while (true) {
const result = await (0, matchmaking_2.findMatch)();
if (result === undefined) {
break;
}
const [usernameA, usernameB, matchId] = result;
await (0, matchmaking_1.notifyNewMatch)(usernameA, usernameB, matchId);
}
};
exports.createMatchIfPossible = createMatchIfPossible;
//# sourceMappingURL=matchmaking.js.map