In AWS GameLift, the following code creates a matchmaking ticket:
import { GameLiftClient, StartMatchmakingCommand } from "@aws-sdk/client-gamelift"; // ES Modules import
// const { GameLiftClient, StartMatchmakingCommand } = require("@aws-sdk/client-gamelift"); // CommonJS import
const client = new GameLiftClient(config);
const command = new StartMatchmakingCommand(input);
const response = await client.send(command);
response
then contains a MatchmakingTicket
, and this has a property called Status
. I was wondering if there was a listener I could attach to the ticket so that I don't have to poll the status using setInterval
? Thanks!