How to use the grpc-web.StatusCode.DEADLINE_EXCEEDED function in grpc-web

To help you get started, weโ€™ve selected a few grpc-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github break-me-if-you-can / services / ui / src / Game.jsx View on Github external
handleGetPlayerIdError = (error) => {
        switch (error.code) {
            case StatusCode.DEADLINE_EXCEEDED:
                this.setState({
                    leaderboardOk: true,
                    notification: CONSTANTS.DEADLINE_NOTIFICATION
                });
                break;
            default:
                this.handleError(error);
        }

        this.getTopPlayerScoreCall();

        if (this.statisticsTopPlayerScoreInterval) {
            clearInterval(this.statisticsTopPlayerScoreInterval);
        }
        this.statisticsTopPlayerScoreInterval = setInterval(this.getTopPlayerScoreCall.bind(this), CONSTANTS.TOP_PLAYER_SCORE_INTERVAL);
    }